aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/eisa
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-11 04:22:22 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:25 -0400
commit42ddfd6859b9d57490c94d26e29a43ffd78366e5 (patch)
treecfbdecd4f3af7824861bdb3a5a7fe95554720c19 /drivers/eisa
parent5e59393ec242d7b772356c95e2be48384cd0c5d7 (diff)
[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')
-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,
226 226
227static int __init eisa_register_device (struct eisa_device *edev) 227static int __init eisa_register_device (struct eisa_device *edev)
228{ 228{
229 if (device_register (&edev->dev)) 229 int rc = device_register (&edev->dev);
230 return -1; 230 if (rc)
231 return rc;
231 232
232 device_create_file (&edev->dev, &dev_attr_signature); 233 rc = device_create_file (&edev->dev, &dev_attr_signature);
233 device_create_file (&edev->dev, &dev_attr_enabled); 234 if (rc) goto err_devreg;
234 device_create_file (&edev->dev, &dev_attr_modalias); 235 rc = device_create_file (&edev->dev, &dev_attr_enabled);
236 if (rc) goto err_sig;
237 rc = device_create_file (&edev->dev, &dev_attr_modalias);
238 if (rc) goto err_enab;
235 239
236 return 0; 240 return 0;
241
242err_enab:
243 device_remove_file (&edev->dev, &dev_attr_enabled);
244err_sig:
245 device_remove_file (&edev->dev, &dev_attr_signature);
246err_devreg:
247 device_unregister(&edev->dev);
248 return rc;
237} 249}
238 250
239static int __init eisa_request_resources (struct eisa_root_device *root, 251static int __init eisa_request_resources (struct eisa_root_device *root,