Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 70770
b: refs/heads/master
c: 348366b
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas authored and Linus Torvalds committed Oct 17, 2007
1 parent 70f2eab commit 168c04f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 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: 36405e96c8090fc8fc05d56755645a5821c98992
refs/heads/master: 348366b963e4e1462c8354827a9cb910aa865bf2
28 changes: 24 additions & 4 deletions trunk/drivers/pnp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ int __pnp_add_device(struct pnp_dev *dev)
spin_unlock(&pnp_lock);

ret = device_register(&dev->dev);
if (ret == 0)
pnp_interface_attach_device(dev);
return ret;
if (ret)
return ret;

pnp_interface_attach_device(dev);
return 0;
}

/*
Expand All @@ -138,12 +140,30 @@ int __pnp_add_device(struct pnp_dev *dev)
*/
int pnp_add_device(struct pnp_dev *dev)
{
int ret;

if (dev->card)
return -EINVAL;

dev->dev.parent = &dev->protocol->dev;
sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number,
dev->number);
return __pnp_add_device(dev);
ret = __pnp_add_device(dev);
if (ret)
return ret;

#ifdef CONFIG_PNP_DEBUG
{
struct pnp_id *id;

dev_printk(KERN_DEBUG, &dev->dev, "%s device, IDs",
dev->protocol->name);
for (id = dev->id; id; id = id->next)
printk(" %s", id->id);
printk(" (%s)\n", dev->active ? "active" : "disabled");
}
#endif
return 0;
}

void __pnp_remove_device(struct pnp_dev *dev)
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/pnp/pnpacpi/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
is_exclusive_device(device))
return 0;

pnp_dbg("ACPI device : hid %s", acpi_device_hid(device));
dev = kzalloc(sizeof(struct pnp_dev), GFP_KERNEL);
if (!dev) {
pnp_err("Out of memory");
Expand Down

0 comments on commit 168c04f

Please sign in to comment.