Commit 6d12b774 authored by Luis Chamberlain's avatar Luis Chamberlain Committed by Greg Kroah-Hartman
Browse files

tty: simplify sysctl registration



register_sysctl_table() is a deprecated compatibility wrapper.
register_sysctl_init() can do the directory creation for you so just use
that

Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20230302204612.782387-7-mcgrof@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 46ce64bb
Loading
Loading
Loading
Loading
+1 −19
Original line number Diff line number Diff line
@@ -3614,31 +3614,13 @@ static struct ctl_table tty_table[] = {
	{ }
};

static struct ctl_table tty_dir_table[] = {
	{
		.procname	= "tty",
		.mode		= 0555,
		.child		= tty_table,
	},
	{ }
};

static struct ctl_table tty_root_table[] = {
	{
		.procname	= "dev",
		.mode		= 0555,
		.child		= tty_dir_table,
	},
	{ }
};

/*
 * Ok, now we can initialize the rest of the tty devices and can count
 * on memory allocations, interrupts etc..
 */
int __init tty_init(void)
{
	register_sysctl_table(tty_root_table);
	register_sysctl_init("dev/tty", tty_table);
	cdev_init(&tty_cdev, &tty_fops);
	if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) ||
	    register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0)