[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230302204612.782387-7-mcgrof@kernel.org>
Date: Thu, 2 Mar 2023 12:46:11 -0800
From: Luis Chamberlain <mcgrof@...nel.org>
To: ebiederm@...ssion.com, keescook@...omium.org, yzaikin@...gle.com,
jejb@...ux.ibm.com, martin.petersen@...cle.com, minyard@....org,
kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
decui@...rosoft.com, song@...nel.org, robinmholt@...il.com,
steve.wahl@....com, mike.travis@....com, arnd@...db.de,
gregkh@...uxfoundation.org, jirislaby@...nel.org, jgross@...e.com,
sstabellini@...nel.org, oleksandr_tyshchenko@...m.com,
xen-devel@...ts.xenproject.org
Cc: j.granados@...sung.com, zhangpeng362@...wei.com,
tangmeng@...ontech.com, willy@...radead.org, nixiaoming@...wei.com,
sujiaxun@...ontech.com, patches@...ts.linux.dev,
linux-fsdevel@...r.kernel.org, apparmor@...ts.ubuntu.com,
linux-raid@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-hyperv@...r.kernel.org,
openipmi-developer@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH 6/7] 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: Luis Chamberlain <mcgrof@...nel.org>
---
drivers/tty/tty_io.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 36fb945fdad4..766750e355ac 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -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)
--
2.39.1
Powered by blists - more mailing lists