aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/eisa
diff options
context:
space:
mode:
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,