aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/dd.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-02-12 22:17:37 -0500
committerKumar Gala <galak@kernel.crashing.org>2007-02-12 22:17:37 -0500
commit06d8bf64ba25db42fcc60d2da2268ac22af94e77 (patch)
treeeb80eebf368957df18c2a4c0ee02897e0a9b06d2 /drivers/base/dd.c
parent8f68abbfd9703e58920ff07d314a48654ed0bc3b (diff)
parent5986a2ec35836a878350c54af4bd91b1de6abc59 (diff)
Merge branch 'master' into for_paulus
Diffstat (limited to 'drivers/base/dd.c')
-rw-r--r--drivers/base/dd.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 510e7884975f..b5bf243d9cd6 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -86,8 +86,12 @@ static void driver_sysfs_remove(struct device *dev)
86 */ 86 */
87int device_bind_driver(struct device *dev) 87int device_bind_driver(struct device *dev)
88{ 88{
89 driver_bound(dev); 89 int ret;
90 return driver_sysfs_add(dev); 90
91 ret = driver_sysfs_add(dev);
92 if (!ret)
93 driver_bound(dev);
94 return ret;
91} 95}
92 96
93struct stupid_thread_structure { 97struct stupid_thread_structure {
@@ -136,18 +140,17 @@ probe_failed:
136 driver_sysfs_remove(dev); 140 driver_sysfs_remove(dev);
137 dev->driver = NULL; 141 dev->driver = NULL;
138 142
139 if (ret == -ENODEV || ret == -ENXIO) { 143 if (ret != -ENODEV && ret != -ENXIO) {
140 /* Driver matched, but didn't support device
141 * or device not found.
142 * Not an error; keep going.
143 */
144 ret = 0;
145 } else {
146 /* driver matched but the probe failed */ 144 /* driver matched but the probe failed */
147 printk(KERN_WARNING 145 printk(KERN_WARNING
148 "%s: probe of %s failed with error %d\n", 146 "%s: probe of %s failed with error %d\n",
149 drv->name, dev->bus_id, ret); 147 drv->name, dev->bus_id, ret);
150 } 148 }
149 /*
150 * Ignore errors returned by ->probe so that the next driver can try
151 * its luck.
152 */
153 ret = 0;
151done: 154done:
152 kfree(data); 155 kfree(data);
153 atomic_dec(&probe_count); 156 atomic_dec(&probe_count);