mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 22:51:35 +00:00
driver core: bus: bus_get_kset() cleanup
Convert the bus_get_kset() function function to use bus_to_subsys() and not use the back-pointer to the private structure. Cc: "Rafael J. Wysocki" <rafael@kernel.org> Link: https://lore.kernel.org/r/20230208111330.439504-10-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
adac037538
commit
beea7892d4
@ -956,7 +956,16 @@ void bus_notify(struct device *dev, enum bus_notifier_event value)
|
||||
|
||||
struct kset *bus_get_kset(struct bus_type *bus)
|
||||
{
|
||||
return &bus->p->subsys;
|
||||
struct subsys_private *sp = bus_to_subsys(bus);
|
||||
struct kset *kset;
|
||||
|
||||
if (!sp)
|
||||
return NULL;
|
||||
|
||||
kset = &sp->subsys;
|
||||
subsys_put(sp);
|
||||
|
||||
return kset;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bus_get_kset);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user