aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-17 03:10:22 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-17 11:18:46 -0400
commit6b5f29675c6a1041aefc147271508bd56cf2b761 (patch)
tree097426aac84e322df5188954b435a86281bbb40a
parent12fda16814bba05a84a49a1da25a069d6c249758 (diff)
[PATCH] I2O: handle a few sysfs errors
Signed-off-by: Jeff Garzik <jeff@garzik.org> Cc: Markus Lidel <Markus.Lidel@shadowconnect.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/message/i2o/bus-osm.c12
-rw-r--r--drivers/message/i2o/exec-osm.c17
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 */
86static int i2o_bus_probe(struct device *dev) 87static 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
100err_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);
325static int i2o_exec_probe(struct device *dev) 325static 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
340err_vid:
341 device_remove_file(dev, &dev_attr_vendor_id);
342err_evtreg:
343 i2o_event_register(to_i2o_device(dev), &i2o_exec_driver, 0, 0);
344err_out:
345 return rc;
335}; 346};
336 347
337/** 348/**