diff options
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 | } |