summaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o/exec-osm.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-17 09:10:22 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-17 17:18:46 +0200
commit6b5f29675c6a1041aefc147271508bd56cf2b761 (patch)
tree097426aac84e322df5188954b435a86281bbb40a /drivers/message/i2o/exec-osm.c
parent[PATCH] drivers/led: handle sysfs errors (diff)
downloadlinux-6b5f29675c6a1041aefc147271508bd56cf2b761.tar.xz
linux-6b5f29675c6a1041aefc147271508bd56cf2b761.zip
[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>
Diffstat (limited to 'drivers/message/i2o/exec-osm.c')
-rw-r--r--drivers/message/i2o/exec-osm.c17
1 files changed, 14 insertions, 3 deletions
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);
static int i2o_exec_probe(struct device *dev)
{
struct i2o_device *i2o_dev = to_i2o_device(dev);
+ int rc;
- i2o_event_register(i2o_dev, &i2o_exec_driver, 0, 0xffffffff);
+ rc = i2o_event_register(i2o_dev, &i2o_exec_driver, 0, 0xffffffff);
+ if (rc) goto err_out;
- device_create_file(dev, &dev_attr_vendor_id);
- device_create_file(dev, &dev_attr_product_id);
+ rc = device_create_file(dev, &dev_attr_vendor_id);
+ if (rc) goto err_evtreg;
+ rc = device_create_file(dev, &dev_attr_product_id);
+ if (rc) goto err_vid;
return 0;
+
+err_vid:
+ device_remove_file(dev, &dev_attr_vendor_id);
+err_evtreg:
+ i2o_event_register(to_i2o_device(dev), &i2o_exec_driver, 0, 0);
+err_out:
+ return rc;
};
/**