Commit b0d78e55 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

kset: convert drivers/base/firmware.c to use kset_create

Dynamically create the kset instead of declaring it statically.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 443dbf90
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
#include "base.h" #include "base.h"
static decl_subsys(firmware, NULL); static struct kset *firmware_kset;
int firmware_register(struct kset *s) int firmware_register(struct kset *s)
{ {
s->kobj.kset = &firmware_subsys; s->kobj.kset = firmware_kset;
s->kobj.ktype = NULL; s->kobj.ktype = NULL;
return subsystem_register(s); return subsystem_register(s);
} }
...@@ -31,7 +31,10 @@ void firmware_unregister(struct kset *s) ...@@ -31,7 +31,10 @@ void firmware_unregister(struct kset *s)
int __init firmware_init(void) int __init firmware_init(void)
{ {
return subsystem_register(&firmware_subsys); firmware_kset = kset_create_and_add("firmware", NULL, NULL);
if (!firmware_kset)
return -ENOMEM;
return 0;
} }
EXPORT_SYMBOL_GPL(firmware_register); EXPORT_SYMBOL_GPL(firmware_register);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment