diff options
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r-- | drivers/base/bus.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 4b04a15146d7..973bf2ad4e0d 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -459,8 +459,9 @@ static inline void remove_deprecated_bus_links(struct device *dev) { } | |||
459 | * bus_add_device - add device to bus | 459 | * bus_add_device - add device to bus |
460 | * @dev: device being added | 460 | * @dev: device being added |
461 | * | 461 | * |
462 | * - Add device's bus attributes. | ||
463 | * - Create links to device's bus. | ||
462 | * - Add the device to its bus's list of devices. | 464 | * - Add the device to its bus's list of devices. |
463 | * - Create link to device's bus. | ||
464 | */ | 465 | */ |
465 | int bus_add_device(struct device *dev) | 466 | int bus_add_device(struct device *dev) |
466 | { | 467 | { |
@@ -483,6 +484,7 @@ int bus_add_device(struct device *dev) | |||
483 | error = make_deprecated_bus_links(dev); | 484 | error = make_deprecated_bus_links(dev); |
484 | if (error) | 485 | if (error) |
485 | goto out_deprecated; | 486 | goto out_deprecated; |
487 | klist_add_tail(&dev->p->knode_bus, &bus->p->klist_devices); | ||
486 | } | 488 | } |
487 | return 0; | 489 | return 0; |
488 | 490 | ||
@@ -498,24 +500,19 @@ out_put: | |||
498 | } | 500 | } |
499 | 501 | ||
500 | /** | 502 | /** |
501 | * bus_attach_device - add device to bus | 503 | * bus_probe_device - probe drivers for a new device |
502 | * @dev: device tried to attach to a driver | 504 | * @dev: device to probe |
503 | * | 505 | * |
504 | * - Add device to bus's list of devices. | 506 | * - Automatically probe for a driver if the bus allows it. |
505 | * - Try to attach to driver. | ||
506 | */ | 507 | */ |
507 | void bus_attach_device(struct device *dev) | 508 | void bus_probe_device(struct device *dev) |
508 | { | 509 | { |
509 | struct bus_type *bus = dev->bus; | 510 | struct bus_type *bus = dev->bus; |
510 | int ret = 0; | 511 | int ret; |
511 | 512 | ||
512 | if (bus) { | 513 | if (bus && bus->p->drivers_autoprobe) { |
513 | if (bus->p->drivers_autoprobe) | 514 | ret = device_attach(dev); |
514 | ret = device_attach(dev); | ||
515 | WARN_ON(ret < 0); | 515 | WARN_ON(ret < 0); |
516 | if (ret >= 0) | ||
517 | klist_add_tail(&dev->p->knode_bus, | ||
518 | &bus->p->klist_devices); | ||
519 | } | 516 | } |
520 | } | 517 | } |
521 | 518 | ||