Commit d9fd4d3b authored by Jeff Garzik's avatar Jeff Garzik Committed by Greg Kroah-Hartman

Driver core: bus: remove indentation level

Before potentially fixing up these functions, this cosmetic change
reduces the indentation level to make the code easier to read and
maintain.

No functional changes at all.
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f70fa629
...@@ -518,7 +518,9 @@ int bus_add_driver(struct device_driver *drv) ...@@ -518,7 +518,9 @@ int bus_add_driver(struct device_driver *drv)
struct bus_type * bus = get_bus(drv->bus); struct bus_type * bus = get_bus(drv->bus);
int error = 0; int error = 0;
if (bus) { if (!bus)
return 0;
pr_debug("bus %s: add driver %s\n", bus->name, drv->name); pr_debug("bus %s: add driver %s\n", bus->name, drv->name);
error = kobject_set_name(&drv->kobj, "%s", drv->name); error = kobject_set_name(&drv->kobj, "%s", drv->name);
if (error) if (error)
...@@ -545,7 +547,7 @@ int bus_add_driver(struct device_driver *drv) ...@@ -545,7 +547,7 @@ int bus_add_driver(struct device_driver *drv)
printk(KERN_ERR "%s: add_bind_files(%s) failed\n", printk(KERN_ERR "%s: add_bind_files(%s) failed\n",
__FUNCTION__, drv->name); __FUNCTION__, drv->name);
} }
}
return error; return error;
out_unregister: out_unregister:
kobject_unregister(&drv->kobj); kobject_unregister(&drv->kobj);
...@@ -565,7 +567,9 @@ int bus_add_driver(struct device_driver *drv) ...@@ -565,7 +567,9 @@ int bus_add_driver(struct device_driver *drv)
void bus_remove_driver(struct device_driver * drv) void bus_remove_driver(struct device_driver * drv)
{ {
if (drv->bus) { if (!drv->bus)
return;
remove_bind_files(drv); remove_bind_files(drv);
driver_remove_attrs(drv->bus, drv); driver_remove_attrs(drv->bus, drv);
klist_remove(&drv->knode_bus); klist_remove(&drv->knode_bus);
...@@ -574,7 +578,6 @@ void bus_remove_driver(struct device_driver * drv) ...@@ -574,7 +578,6 @@ void bus_remove_driver(struct device_driver * drv)
module_remove_driver(drv); module_remove_driver(drv);
kobject_unregister(&drv->kobj); kobject_unregister(&drv->kobj);
put_bus(drv->bus); put_bus(drv->bus);
}
} }
......
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