Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42767
b: refs/heads/master
c: bfc7ee2
h: refs/heads/master
i:
  42765: 438d813
  42763: 7591996
  42759: 58cb65a
  42751: a78ab00
v: v3
  • Loading branch information
Jeff Garzik authored and Linus Torvalds committed Dec 7, 2006
1 parent 80c71a5 commit 28f4b6c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3889b26bebd3e3cf5a3b95da683bab2f6462133d
refs/heads/master: bfc7ee207078e8ca51264355805e6f56b485be4b
30 changes: 21 additions & 9 deletions trunk/drivers/pnp/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,17 @@ static DEVICE_ATTR(card_id,S_IRUGO,pnp_show_card_ids,NULL);

static int pnp_interface_attach_card(struct pnp_card *card)
{
device_create_file(&card->dev,&dev_attr_name);
device_create_file(&card->dev,&dev_attr_card_id);
int rc = device_create_file(&card->dev,&dev_attr_name);
if (rc) return rc;

rc = device_create_file(&card->dev,&dev_attr_card_id);
if (rc) goto err_name;

return 0;

err_name:
device_remove_file(&card->dev,&dev_attr_name);
return rc;
}

/**
Expand Down Expand Up @@ -306,16 +314,20 @@ struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char
down_write(&dev->dev.bus->subsys.rwsem);
dev->card_link = clink;
dev->dev.driver = &drv->link.driver;
if (pnp_bus_type.probe(&dev->dev)) {
dev->dev.driver = NULL;
dev->card_link = NULL;
up_write(&dev->dev.bus->subsys.rwsem);
return NULL;
}
device_bind_driver(&dev->dev);
if (pnp_bus_type.probe(&dev->dev))
goto err_out;
if (device_bind_driver(&dev->dev))
goto err_out;

up_write(&dev->dev.bus->subsys.rwsem);

return dev;

err_out:
dev->dev.driver = NULL;
dev->card_link = NULL;
up_write(&dev->dev.bus->subsys.rwsem);
return NULL;
}

/**
Expand Down
17 changes: 14 additions & 3 deletions trunk/drivers/pnp/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,19 @@ static DEVICE_ATTR(id,S_IRUGO,pnp_show_current_ids,NULL);

int pnp_interface_attach_device(struct pnp_dev *dev)
{
device_create_file(&dev->dev,&dev_attr_options);
device_create_file(&dev->dev,&dev_attr_resources);
device_create_file(&dev->dev,&dev_attr_id);
int rc = device_create_file(&dev->dev,&dev_attr_options);
if (rc) goto err;
rc = device_create_file(&dev->dev,&dev_attr_resources);
if (rc) goto err_opt;
rc = device_create_file(&dev->dev,&dev_attr_id);
if (rc) goto err_res;

return 0;

err_res:
device_remove_file(&dev->dev,&dev_attr_resources);
err_opt:
device_remove_file(&dev->dev,&dev_attr_options);
err:
return rc;
}

0 comments on commit 28f4b6c

Please sign in to comment.