diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-14 13:42:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-14 13:42:40 -0500 |
commit | 3e2b32b69308e974cd1167beaf266d3c716e4734 (patch) | |
tree | 0f1b24dcb7b066a6322d33235b95655d885695ac /drivers/base/dd.c | |
parent | 3824ba7df91745da6ebac703c87c3b801c34fdd0 (diff) | |
parent | 9c08a938ce5a3e1c9d5f764dc6ae844cb1af76ff (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
Diffstat (limited to 'drivers/base/dd.c')
-rw-r--r-- | drivers/base/dd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 2b905016664d..730a9ce0a14a 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
@@ -78,7 +78,13 @@ int driver_probe_device(struct device_driver * drv, struct device * dev) | |||
78 | pr_debug("%s: Matched Device %s with Driver %s\n", | 78 | pr_debug("%s: Matched Device %s with Driver %s\n", |
79 | drv->bus->name, dev->bus_id, drv->name); | 79 | drv->bus->name, dev->bus_id, drv->name); |
80 | dev->driver = drv; | 80 | dev->driver = drv; |
81 | if (drv->probe) { | 81 | if (dev->bus->probe) { |
82 | ret = dev->bus->probe(dev); | ||
83 | if (ret) { | ||
84 | dev->driver = NULL; | ||
85 | goto ProbeFailed; | ||
86 | } | ||
87 | } else if (drv->probe) { | ||
82 | ret = drv->probe(dev); | 88 | ret = drv->probe(dev); |
83 | if (ret) { | 89 | if (ret) { |
84 | dev->driver = NULL; | 90 | dev->driver = NULL; |
@@ -203,7 +209,9 @@ static void __device_release_driver(struct device * dev) | |||
203 | sysfs_remove_link(&dev->kobj, "driver"); | 209 | sysfs_remove_link(&dev->kobj, "driver"); |
204 | klist_remove(&dev->knode_driver); | 210 | klist_remove(&dev->knode_driver); |
205 | 211 | ||
206 | if (drv->remove) | 212 | if (dev->bus->remove) |
213 | dev->bus->remove(dev); | ||
214 | else if (drv->remove) | ||
207 | drv->remove(dev); | 215 | drv->remove(dev); |
208 | dev->driver = NULL; | 216 | dev->driver = NULL; |
209 | put_driver(drv); | 217 | put_driver(drv); |