mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
kset: convert drivers/base/bus.c to use kset_create
Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
bd35b93d80
commit
59a548338a
1 changed files with 7 additions and 4 deletions
|
@ -166,7 +166,7 @@ static struct kset_uevent_ops bus_uevent_ops = {
|
||||||
.filter = bus_uevent_filter,
|
.filter = bus_uevent_filter,
|
||||||
};
|
};
|
||||||
|
|
||||||
static decl_subsys(bus, &bus_uevent_ops);
|
static struct kset *bus_kset;
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_HOTPLUG
|
#ifdef CONFIG_HOTPLUG
|
||||||
|
@ -767,7 +767,7 @@ EXPORT_SYMBOL_GPL(device_reprobe);
|
||||||
#if 0
|
#if 0
|
||||||
struct bus_type * find_bus(char * name)
|
struct bus_type * find_bus(char * name)
|
||||||
{
|
{
|
||||||
struct kobject * k = kset_find_obj(&bus_subsys.kset, name);
|
struct kobject * k = kset_find_obj(bus_kset, name);
|
||||||
return k ? to_bus(k) : NULL;
|
return k ? to_bus(k) : NULL;
|
||||||
}
|
}
|
||||||
#endif /* 0 */
|
#endif /* 0 */
|
||||||
|
@ -851,7 +851,7 @@ int bus_register(struct bus_type * bus)
|
||||||
if (retval)
|
if (retval)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
bus->subsys.kobj.kset = &bus_subsys;
|
bus->subsys.kobj.kset = bus_kset;
|
||||||
bus->subsys.kobj.ktype = &bus_ktype;
|
bus->subsys.kobj.ktype = &bus_ktype;
|
||||||
|
|
||||||
retval = subsystem_register(&bus->subsys);
|
retval = subsystem_register(&bus->subsys);
|
||||||
|
@ -935,7 +935,10 @@ EXPORT_SYMBOL_GPL(bus_unregister_notifier);
|
||||||
|
|
||||||
int __init buses_init(void)
|
int __init buses_init(void)
|
||||||
{
|
{
|
||||||
return subsystem_register(&bus_subsys);
|
bus_kset = kset_create_and_add("bus", &bus_uevent_ops, NULL);
|
||||||
|
if (!bus_kset)
|
||||||
|
return -ENOMEM;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue