Skip to content

Commit

Permalink
[PATCH] EISA: handle sysfs errors
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jeff Garzik authored and Linus Torvalds committed Oct 11, 2006
1 parent 5e59393 commit 42ddfd6
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions drivers/eisa/eisa-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 42ddfd6

Please sign in to comment.