kset: convert struct bus_device->drivers to use kset_create

Dynamically create the kset instead of declaring it statically.

Having 3 static kobjects in one structure is not only foolish, but ripe
for nasty race conditions if handled improperly.  We also rename the
field to catch any potential users of it (not that there should be
outside of the driver core...)

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman
2007-11-01 13:31:26 -07:00
parent 3d8995963d
commit 6dcec2511f
3 changed files with 10 additions and 9 deletions

View File

@@ -185,7 +185,7 @@ void driver_unregister(struct device_driver * drv)
*/
struct device_driver *driver_find(const char *name, struct bus_type *bus)
{
struct kobject *k = kset_find_obj(&bus->drivers, name);
struct kobject *k = kset_find_obj(bus->drivers_kset, name);
if (k)
return to_drv(k);
return NULL;