aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r--drivers/base/bus.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 9df2e6dff519..20b6dc8706fa 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -447,7 +447,7 @@ out_put:
447 * - Add device to bus's list of devices. 447 * - Add device to bus's list of devices.
448 * - Try to attach to driver. 448 * - Try to attach to driver.
449 */ 449 */
450int bus_attach_device(struct device * dev) 450void bus_attach_device(struct device * dev)
451{ 451{
452 struct bus_type *bus = dev->bus; 452 struct bus_type *bus = dev->bus;
453 int ret = 0; 453 int ret = 0;
@@ -456,13 +456,12 @@ int bus_attach_device(struct device * dev)
456 dev->is_registered = 1; 456 dev->is_registered = 1;
457 if (bus->drivers_autoprobe) 457 if (bus->drivers_autoprobe)
458 ret = device_attach(dev); 458 ret = device_attach(dev);
459 if (ret >= 0) { 459 WARN_ON(ret < 0);
460 if (ret >= 0)
460 klist_add_tail(&dev->knode_bus, &bus->klist_devices); 461 klist_add_tail(&dev->knode_bus, &bus->klist_devices);
461 ret = 0; 462 else
462 } else
463 dev->is_registered = 0; 463 dev->is_registered = 0;
464 } 464 }
465 return ret;
466} 465}
467 466
468/** 467/**
@@ -669,8 +668,6 @@ static int __must_check bus_rescan_devices_helper(struct device *dev,
669 ret = device_attach(dev); 668 ret = device_attach(dev);
670 if (dev->parent) 669 if (dev->parent)
671 up(&dev->parent->sem); 670 up(&dev->parent->sem);
672 if (ret > 0)
673 ret = 0;
674 } 671 }
675 return ret < 0 ? ret : 0; 672 return ret < 0 ? ret : 0;
676} 673}