driver core: don't trigger uevent after failure

Do not send the uevent if driver_add_groups failed.

Reported-by: Ming Lei <ming.lei@canonical.com>
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-17 10:39:10 +02:00 committed by Greg Kroah-Hartman
parent db1b903742
commit a14af32564

View file

@ -185,9 +185,10 @@ int driver_register(struct device_driver *drv)
if (ret) if (ret)
return ret; return ret;
ret = driver_add_groups(drv, drv->groups); ret = driver_add_groups(drv, drv->groups);
if (ret) if (ret) {
bus_remove_driver(drv); bus_remove_driver(drv);
return ret;
}
kobject_uevent(&drv->p->kobj, KOBJ_ADD); kobject_uevent(&drv->p->kobj, KOBJ_ADD);
return ret; return ret;