From 5a7689fd5b4f2094e7a32beae67f290f8619b042 Mon Sep 17 00:00:00 2001 From: Sebastian Ott Date: Mon, 2 Jul 2012 19:08:15 +0200 Subject: driver core: move uevent call to driver_register Device driver attribute groups are created after userspace is notified via an add event. Fix this by moving the kobject_uevent call to driver_register after the attribute groups are added. Signed-off-by: Sebastian Ott Signed-off-by: Greg Kroah-Hartman --- drivers/base/bus.c | 1 - drivers/base/driver.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/base') diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 2bcef657a60c..181ed2660b33 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -743,7 +743,6 @@ int bus_add_driver(struct device_driver *drv) } } - kobject_uevent(&priv->kobj, KOBJ_ADD); return 0; out_unregister: diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 207c27ddf828..1b500d6fcc2e 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -187,6 +187,9 @@ int driver_register(struct device_driver *drv) ret = driver_add_groups(drv, drv->groups); if (ret) bus_remove_driver(drv); + + kobject_uevent(&drv->p->kobj, KOBJ_ADD); + return ret; } EXPORT_SYMBOL_GPL(driver_register); -- cgit v1.2.3