Skip to content

Commit

Permalink
md: simplify sysctl registration
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Song Liu <[email protected]>
  • Loading branch information
mcgrof committed Apr 13, 2023
1 parent 525f23f commit 9adcf9d
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,26 +322,6 @@ static struct ctl_table raid_table[] = {
{ }
};

static struct ctl_table raid_dir_table[] = {
{
.procname = "raid",
.maxlen = 0,
.mode = S_IRUGO|S_IXUGO,
.child = raid_table,
},
{ }
};

static struct ctl_table raid_root_table[] = {
{
.procname = "dev",
.maxlen = 0,
.mode = 0555,
.child = raid_dir_table,
},
{ }
};

static int start_readonly;

/*
Expand Down Expand Up @@ -9649,7 +9629,7 @@ static int __init md_init(void)
mdp_major = ret;

register_reboot_notifier(&md_notifier);
raid_table_header = register_sysctl_table(raid_root_table);
raid_table_header = register_sysctl("dev/raid", raid_table);

md_geninit();
return 0;
Expand Down

0 comments on commit 9adcf9d

Please sign in to comment.