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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Sebastian Ott 2012-07-02 19:08:15 +02:00 committed by Greg Kroah-Hartman
parent d1c6c030fc
commit 5a7689fd5b
2 changed files with 3 additions and 1 deletions

View File

@ -743,7 +743,6 @@ int bus_add_driver(struct device_driver *drv)
}
}
kobject_uevent(&priv->kobj, KOBJ_ADD);
return 0;
out_unregister:

View File

@ -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);