summaryrefslogtreecommitdiff
path: root/drivers/eisa/eisa-bus.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-11 12:22:22 +0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 22:14:25 +0400
commit42ddfd6859b9d57490c94d26e29a43ffd78366e5 (patch)
treecfbdecd4f3af7824861bdb3a5a7fe95554720c19 /drivers/eisa/eisa-bus.c
parent5e59393ec242d7b772356c95e2be48384cd0c5d7 (diff)
downloadlinux-42ddfd6859b9d57490c94d26e29a43ffd78366e5.tar.xz
[PATCH] EISA: handle sysfs errors
Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/eisa/eisa-bus.c')
-rw-r--r--drivers/eisa/eisa-bus.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index 3a365e159d89..d944647c82c2 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -226,14 +226,26 @@ static int __init eisa_init_device (struct eisa_root_device *root,
static int __init eisa_register_device (struct eisa_device *edev)
{
- if (device_register (&edev->dev))
- return -1;
+ int rc = device_register (&edev->dev);
+ if (rc)
+ return rc;
- device_create_file (&edev->dev, &dev_attr_signature);
- device_create_file (&edev->dev, &dev_attr_enabled);
- device_create_file (&edev->dev, &dev_attr_modalias);
+ rc = device_create_file (&edev->dev, &dev_attr_signature);
+ if (rc) goto err_devreg;
+ rc = device_create_file (&edev->dev, &dev_attr_enabled);
+ if (rc) goto err_sig;
+ rc = device_create_file (&edev->dev, &dev_attr_modalias);
+ if (rc) goto err_enab;
return 0;
+
+err_enab:
+ device_remove_file (&edev->dev, &dev_attr_enabled);
+err_sig:
+ device_remove_file (&edev->dev, &dev_attr_signature);
+err_devreg:
+ device_unregister(&edev->dev);
+ return rc;
}
static int __init eisa_request_resources (struct eisa_root_device *root,