lkml.org 
[lkml]   [2012]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 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 <sebott@linux.vnet.ibm.com>
---
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);


\
 
 \ /
  Last update: 2012-07-02 19:42    [W:0.061 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site