diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-12-06 23:35:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:31 -0500 |
commit | bfc7ee207078e8ca51264355805e6f56b485be4b (patch) | |
tree | fe06871e1a6e83ed13b50aa2cef827a6f10b0ade /drivers/pnp/interface.c | |
parent | 3889b26bebd3e3cf5a3b95da683bab2f6462133d (diff) |
[PATCH] PNP: handle sysfs errors
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pnp/interface.c')
-rw-r--r-- | drivers/pnp/interface.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c index 9d8b415eca79..ac9fcd499f3f 100644 --- a/drivers/pnp/interface.c +++ b/drivers/pnp/interface.c | |||
@@ -461,8 +461,19 @@ static DEVICE_ATTR(id,S_IRUGO,pnp_show_current_ids,NULL); | |||
461 | 461 | ||
462 | int pnp_interface_attach_device(struct pnp_dev *dev) | 462 | int pnp_interface_attach_device(struct pnp_dev *dev) |
463 | { | 463 | { |
464 | device_create_file(&dev->dev,&dev_attr_options); | 464 | int rc = device_create_file(&dev->dev,&dev_attr_options); |
465 | device_create_file(&dev->dev,&dev_attr_resources); | 465 | if (rc) goto err; |
466 | device_create_file(&dev->dev,&dev_attr_id); | 466 | rc = device_create_file(&dev->dev,&dev_attr_resources); |
467 | if (rc) goto err_opt; | ||
468 | rc = device_create_file(&dev->dev,&dev_attr_id); | ||
469 | if (rc) goto err_res; | ||
470 | |||
467 | return 0; | 471 | return 0; |
472 | |||
473 | err_res: | ||
474 | device_remove_file(&dev->dev,&dev_attr_resources); | ||
475 | err_opt: | ||
476 | device_remove_file(&dev->dev,&dev_attr_options); | ||
477 | err: | ||
478 | return rc; | ||
468 | } | 479 | } |