diff options
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r-- | drivers/base/bus.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index ab53832d57e5..17e96698410e 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -156,7 +156,9 @@ static ssize_t driver_unbind(struct device_driver *drv, | |||
156 | device_release_driver(dev); | 156 | device_release_driver(dev); |
157 | err = count; | 157 | err = count; |
158 | } | 158 | } |
159 | return err; | 159 | if (err) |
160 | return err; | ||
161 | return count; | ||
160 | } | 162 | } |
161 | static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind); | 163 | static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind); |
162 | 164 | ||
@@ -358,7 +360,7 @@ int bus_add_device(struct device * dev) | |||
358 | if (bus) { | 360 | if (bus) { |
359 | pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id); | 361 | pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id); |
360 | device_attach(dev); | 362 | device_attach(dev); |
361 | klist_add_tail(&bus->klist_devices, &dev->knode_bus); | 363 | klist_add_tail(&dev->knode_bus, &bus->klist_devices); |
362 | error = device_add_attrs(bus, dev); | 364 | error = device_add_attrs(bus, dev); |
363 | if (!error) { | 365 | if (!error) { |
364 | sysfs_create_link(&bus->devices.kobj, &dev->kobj, dev->bus_id); | 366 | sysfs_create_link(&bus->devices.kobj, &dev->kobj, dev->bus_id); |
@@ -446,7 +448,7 @@ int bus_add_driver(struct device_driver * drv) | |||
446 | } | 448 | } |
447 | 449 | ||
448 | driver_attach(drv); | 450 | driver_attach(drv); |
449 | klist_add_tail(&bus->klist_drivers, &drv->knode_bus); | 451 | klist_add_tail(&drv->knode_bus, &bus->klist_drivers); |
450 | module_add_driver(drv->owner, drv); | 452 | module_add_driver(drv->owner, drv); |
451 | 453 | ||
452 | driver_add_attrs(bus, drv); | 454 | driver_add_attrs(bus, drv); |