diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/message/i2o/bus-osm.c | 12 | ||||
-rw-r--r-- | drivers/message/i2o/exec-osm.c | 17 |
2 files changed, 24 insertions, 5 deletions
diff --git a/drivers/message/i2o/bus-osm.c b/drivers/message/i2o/bus-osm.c index ac06f10c54ec..d96c687aee93 100644 --- a/drivers/message/i2o/bus-osm.c +++ b/drivers/message/i2o/bus-osm.c | |||
@@ -80,18 +80,26 @@ static DEVICE_ATTR(scan, S_IWUSR, NULL, i2o_bus_store_scan); | |||
80 | * @dev: device to verify if it is a I2O Bus Adapter device | 80 | * @dev: device to verify if it is a I2O Bus Adapter device |
81 | * | 81 | * |
82 | * Because we want all Bus Adapters always return 0. | 82 | * Because we want all Bus Adapters always return 0. |
83 | * Except when we fail. Then we are sad. | ||
83 | * | 84 | * |
84 | * Returns 0. | 85 | * Returns 0, except when we fail to excel. |
85 | */ | 86 | */ |
86 | static int i2o_bus_probe(struct device *dev) | 87 | static int i2o_bus_probe(struct device *dev) |
87 | { | 88 | { |
88 | struct i2o_device *i2o_dev = to_i2o_device(get_device(dev)); | 89 | struct i2o_device *i2o_dev = to_i2o_device(get_device(dev)); |
90 | int rc; | ||
89 | 91 | ||
90 | device_create_file(dev, &dev_attr_scan); | 92 | rc = device_create_file(dev, &dev_attr_scan); |
93 | if (rc) | ||
94 | goto err_out; | ||
91 | 95 | ||
92 | osm_info("device added (TID: %03x)\n", i2o_dev->lct_data.tid); | 96 | osm_info("device added (TID: %03x)\n", i2o_dev->lct_data.tid); |
93 | 97 | ||
94 | return 0; | 98 | return 0; |
99 | |||
100 | err_out: | ||
101 | put_device(dev); | ||
102 | return rc; | ||
95 | }; | 103 | }; |
96 | 104 | ||
97 | /** | 105 | /** |
diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c index 7bd4d85d0b42..91f95d172ca5 100644 --- a/drivers/message/i2o/exec-osm.c +++ b/drivers/message/i2o/exec-osm.c | |||
@@ -325,13 +325,24 @@ static DEVICE_ATTR(product_id, S_IRUGO, i2o_exec_show_product_id, NULL); | |||
325 | static int i2o_exec_probe(struct device *dev) | 325 | static int i2o_exec_probe(struct device *dev) |
326 | { | 326 | { |
327 | struct i2o_device *i2o_dev = to_i2o_device(dev); | 327 | struct i2o_device *i2o_dev = to_i2o_device(dev); |
328 | int rc; | ||
328 | 329 | ||
329 | i2o_event_register(i2o_dev, &i2o_exec_driver, 0, 0xffffffff); | 330 | rc = i2o_event_register(i2o_dev, &i2o_exec_driver, 0, 0xffffffff); |
331 | if (rc) goto err_out; | ||
330 | 332 | ||
331 | device_create_file(dev, &dev_attr_vendor_id); | 333 | rc = device_create_file(dev, &dev_attr_vendor_id); |
332 | device_create_file(dev, &dev_attr_product_id); | 334 | if (rc) goto err_evtreg; |
335 | rc = device_create_file(dev, &dev_attr_product_id); | ||
336 | if (rc) goto err_vid; | ||
333 | 337 | ||
334 | return 0; | 338 | return 0; |
339 | |||
340 | err_vid: | ||
341 | device_remove_file(dev, &dev_attr_vendor_id); | ||
342 | err_evtreg: | ||
343 | i2o_event_register(to_i2o_device(dev), &i2o_exec_driver, 0, 0); | ||
344 | err_out: | ||
345 | return rc; | ||
335 | }; | 346 | }; |
336 | 347 | ||
337 | /** | 348 | /** |