scsi: simplify sysctl registration with register_sysctl()
authorLuis Chamberlain <mcgrof@kernel.org>
Thu, 2 Mar 2023 20:46:06 +0000 (12:46 -0800)
committerLuis Chamberlain <mcgrof@kernel.org>
Thu, 13 Apr 2023 18:49:20 +0000 (11:49 -0700)
register_sysctl_table() is a deprecated compatibility wrapper.
register_sysctl() can do the directory creation for you so just use that.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
drivers/scsi/scsi_sysctl.c

index 7259704a7f524ac49c60a63a72fc1db4a9a7903d..7f0914ea168f8937783ff8715a1739fec469f9a6 100644 (file)
@@ -21,25 +21,11 @@ static struct ctl_table scsi_table[] = {
        { }
 };
 
-static struct ctl_table scsi_dir_table[] = {
-       { .procname     = "scsi",
-         .mode         = 0555,
-         .child        = scsi_table },
-       { }
-};
-
-static struct ctl_table scsi_root_table[] = {
-       { .procname     = "dev",
-         .mode         = 0555,
-         .child        = scsi_dir_table },
-       { }
-};
-
 static struct ctl_table_header *scsi_table_header;
 
 int __init scsi_init_sysctl(void)
 {
-       scsi_table_header = register_sysctl_table(scsi_root_table);
+       scsi_table_header = register_sysctl("dev/scsi", scsi_table);
        if (!scsi_table_header)
                return -ENOMEM;
        return 0;