diff options
Diffstat (limited to 'drivers/base/dd.c')
-rw-r--r-- | drivers/base/dd.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 159e0623a681..dd2a8a79c121 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
@@ -88,20 +88,23 @@ static int __device_attach(struct device_driver * drv, void * data) | |||
88 | int error; | 88 | int error; |
89 | 89 | ||
90 | error = driver_probe_device(drv, dev); | 90 | error = driver_probe_device(drv, dev); |
91 | 91 | if (error) { | |
92 | if (error == -ENODEV && error == -ENXIO) { | 92 | if ((error == -ENODEV) || (error == -ENXIO)) { |
93 | /* Driver matched, but didn't support device | 93 | /* Driver matched, but didn't support device |
94 | * or device not found. | 94 | * or device not found. |
95 | * Not an error; keep going. | 95 | * Not an error; keep going. |
96 | */ | 96 | */ |
97 | error = 0; | 97 | error = 0; |
98 | } else { | 98 | } else { |
99 | /* driver matched but the probe failed */ | 99 | /* driver matched but the probe failed */ |
100 | printk(KERN_WARNING | 100 | printk(KERN_WARNING |
101 | "%s: probe of %s failed with error %d\n", | 101 | "%s: probe of %s failed with error %d\n", |
102 | drv->name, dev->bus_id, error); | 102 | drv->name, dev->bus_id, error); |
103 | } | ||
104 | return error; | ||
103 | } | 105 | } |
104 | return 0; | 106 | /* stop looking, this device is attached */ |
107 | return 1; | ||
105 | } | 108 | } |
106 | 109 | ||
107 | /** | 110 | /** |
@@ -137,7 +140,10 @@ static int __driver_attach(struct device * dev, void * data) | |||
137 | drv->name, dev->bus_id, error); | 140 | drv->name, dev->bus_id, error); |
138 | } else | 141 | } else |
139 | error = 0; | 142 | error = 0; |
143 | return error; | ||
140 | } | 144 | } |
145 | /* stop looking, this driver is attached */ | ||
146 | return 1; | ||
141 | } | 147 | } |
142 | return 0; | 148 | return 0; |
143 | } | 149 | } |