Commit dc0afa83 authored by Cornelia Huck's avatar Cornelia Huck Committed by Greg Kroah-Hartman

Driver core: coding style cleanup

This converts code of the form

	if ((error = some_func()))
		goto fixup;
to
	error = some_func();
	if (error)
		goto fixup;
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 93160c63
...@@ -622,7 +622,8 @@ int bus_add_driver(struct device_driver *drv) ...@@ -622,7 +622,8 @@ int bus_add_driver(struct device_driver *drv)
if (error) if (error)
goto out_put_bus; goto out_put_bus;
drv->kobj.kset = &bus->drivers; drv->kobj.kset = &bus->drivers;
if ((error = kobject_register(&drv->kobj))) error = kobject_register(&drv->kobj);
if (error)
goto out_put_bus; goto out_put_bus;
if (drv->bus->drivers_autoprobe) { if (drv->bus->drivers_autoprobe) {
...@@ -772,7 +773,8 @@ static int bus_add_attrs(struct bus_type * bus) ...@@ -772,7 +773,8 @@ static int bus_add_attrs(struct bus_type * bus)
if (bus->bus_attrs) { if (bus->bus_attrs) {
for (i = 0; attr_name(bus->bus_attrs[i]); i++) { for (i = 0; attr_name(bus->bus_attrs[i]); i++) {
if ((error = bus_create_file(bus,&bus->bus_attrs[i]))) error = bus_create_file(bus,&bus->bus_attrs[i]);
if (error)
goto Err; goto Err;
} }
} }
......
...@@ -733,11 +733,14 @@ int device_add(struct device *dev) ...@@ -733,11 +733,14 @@ int device_add(struct device *dev)
} }
} }
if ((error = device_add_attrs(dev))) error = device_add_attrs(dev);
if (error)
goto AttrsError; goto AttrsError;
if ((error = device_pm_add(dev))) error = device_pm_add(dev);
if (error)
goto PMError; goto PMError;
if ((error = bus_add_device(dev))) error = bus_add_device(dev);
if (error)
goto BusError; goto BusError;
kobject_uevent(&dev->kobj, KOBJ_ADD); kobject_uevent(&dev->kobj, KOBJ_ADD);
bus_attach_device(dev); bus_attach_device(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment