[PATCH] driver core: move uevent call to driver_register

From: Sebastian Ott
Date: Mon Jul 02 2012 - 13:08:21 EST



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 <sebott@xxxxxxxxxxxxxxxxxx>
---
drivers/base/bus.c | 1 -
drivers/base/driver.c | 3 +++
2 files changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -743,7 +743,6 @@ int bus_add_driver(struct device_driver
}
}

- kobject_uevent(&priv->kobj, KOBJ_ADD);
return 0;

out_unregister:
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -187,6 +187,9 @@ int driver_register(struct device_driver
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);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/