diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2007-07-09 14:39:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:09:02 -0400 |
commit | dc0afa8388972a9ed7c2203cc46d8df1a4713f65 (patch) | |
tree | a4693ef5ac039e868c3c53b72b504868f5199998 /drivers/base | |
parent | 93160c6397e460bc4c7ac15323fb698f91ef02e5 (diff) |
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: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/bus.c | 6 | ||||
-rw-r--r-- | drivers/base/core.c | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 7ff5aafe2167..f299e0d6abc4 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -622,7 +622,8 @@ int bus_add_driver(struct device_driver *drv) | |||
622 | if (error) | 622 | if (error) |
623 | goto out_put_bus; | 623 | goto out_put_bus; |
624 | drv->kobj.kset = &bus->drivers; | 624 | drv->kobj.kset = &bus->drivers; |
625 | if ((error = kobject_register(&drv->kobj))) | 625 | error = kobject_register(&drv->kobj); |
626 | if (error) | ||
626 | goto out_put_bus; | 627 | goto out_put_bus; |
627 | 628 | ||
628 | if (drv->bus->drivers_autoprobe) { | 629 | if (drv->bus->drivers_autoprobe) { |
@@ -772,7 +773,8 @@ static int bus_add_attrs(struct bus_type * bus) | |||
772 | 773 | ||
773 | if (bus->bus_attrs) { | 774 | if (bus->bus_attrs) { |
774 | for (i = 0; attr_name(bus->bus_attrs[i]); i++) { | 775 | for (i = 0; attr_name(bus->bus_attrs[i]); i++) { |
775 | if ((error = bus_create_file(bus,&bus->bus_attrs[i]))) | 776 | error = bus_create_file(bus,&bus->bus_attrs[i]); |
777 | if (error) | ||
776 | goto Err; | 778 | goto Err; |
777 | } | 779 | } |
778 | } | 780 | } |
diff --git a/drivers/base/core.c b/drivers/base/core.c index dd40d78a023d..cff4fbfbb055 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -733,11 +733,14 @@ int device_add(struct device *dev) | |||
733 | } | 733 | } |
734 | } | 734 | } |
735 | 735 | ||
736 | if ((error = device_add_attrs(dev))) | 736 | error = device_add_attrs(dev); |
737 | if (error) | ||
737 | goto AttrsError; | 738 | goto AttrsError; |
738 | if ((error = device_pm_add(dev))) | 739 | error = device_pm_add(dev); |
740 | if (error) | ||
739 | goto PMError; | 741 | goto PMError; |
740 | if ((error = bus_add_device(dev))) | 742 | error = bus_add_device(dev); |
743 | if (error) | ||
741 | goto BusError; | 744 | goto BusError; |
742 | kobject_uevent(&dev->kobj, KOBJ_ADD); | 745 | kobject_uevent(&dev->kobj, KOBJ_ADD); |
743 | bus_attach_device(dev); | 746 | bus_attach_device(dev); |