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 коммит произвёл Greg Kroah-Hartman
Родитель d1c6c030fc
Коммит 5a7689fd5b
2 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

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

Просмотреть файл

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