diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2007-02-05 19:15:26 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-04-27 13:57:29 -0400 |
commit | c6a46696f97ff260a4ecce5e287f8de4b9d7fe14 (patch) | |
tree | 335de50c9868cd575f535677e430677d33cbaaa1 /drivers/base/core.c | |
parent | eed40d3ad2ba652c08422d62a5ff6f62ac0be16d (diff) |
driver core: don't fail attaching the device if it cannot be bound
Don't fail bus_attach_device() if the device cannot be bound.
If dev->driver has been specified, reset it to NULL if device_bind_driver()
failed and add the device as an unbound device. As a result,
bus_attach_device() now cannot fail, and we can remove some checking from
device_add().
Also remove an unneeded check in bus_rescan_devices_helper().
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/core.c')
-rw-r--r-- | drivers/base/core.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index bffb69e4bde2..be6aeb430798 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -677,8 +677,7 @@ int device_add(struct device *dev) | |||
677 | goto BusError; | 677 | goto BusError; |
678 | if (!dev->uevent_suppress) | 678 | if (!dev->uevent_suppress) |
679 | kobject_uevent(&dev->kobj, KOBJ_ADD); | 679 | kobject_uevent(&dev->kobj, KOBJ_ADD); |
680 | if ((error = bus_attach_device(dev))) | 680 | bus_attach_device(dev); |
681 | goto AttachError; | ||
682 | if (parent) | 681 | if (parent) |
683 | klist_add_tail(&dev->knode_parent, &parent->klist_children); | 682 | klist_add_tail(&dev->knode_parent, &parent->klist_children); |
684 | 683 | ||
@@ -697,8 +696,6 @@ int device_add(struct device *dev) | |||
697 | kfree(class_name); | 696 | kfree(class_name); |
698 | put_device(dev); | 697 | put_device(dev); |
699 | return error; | 698 | return error; |
700 | AttachError: | ||
701 | bus_remove_device(dev); | ||
702 | BusError: | 699 | BusError: |
703 | device_pm_remove(dev); | 700 | device_pm_remove(dev); |
704 | PMError: | 701 | PMError: |