Commit 69d8e1389551b107b1a8ec70c280cb7a56096666
1 parent
5c89e17e9c
Exists in
master
and in
20 other branches
kobject: convert securityfs to use kobject_create
We don't need a kset here, a simple kobject will do just fine, so dynamically create the kobject and use it. Cc: Kay Sievers <kay.sievers@vrfy.org> Acked-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 1 changed file with 5 additions and 6 deletions Side-by-side Diff
security/inode.c
... | ... | @@ -315,20 +315,19 @@ |
315 | 315 | } |
316 | 316 | EXPORT_SYMBOL_GPL(securityfs_remove); |
317 | 317 | |
318 | -static decl_subsys(security, NULL); | |
318 | +static struct kobject *security_kobj; | |
319 | 319 | |
320 | 320 | static int __init securityfs_init(void) |
321 | 321 | { |
322 | 322 | int retval; |
323 | 323 | |
324 | - security_subsys.kobj.kset = &kernel_subsys; | |
325 | - retval = subsystem_register(&security_subsys); | |
326 | - if (retval) | |
327 | - return retval; | |
324 | + security_kobj = kobject_create_and_add("security", &kernel_subsys.kobj); | |
325 | + if (!security_kobj) | |
326 | + return -EINVAL; | |
328 | 327 | |
329 | 328 | retval = register_filesystem(&fs_type); |
330 | 329 | if (retval) |
331 | - subsystem_unregister(&security_subsys); | |
330 | + kobject_unregister(security_kobj); | |
332 | 331 | return retval; |
333 | 332 | } |
334 | 333 |