diff options
Diffstat (limited to 'drivers/pnp/pnpbios')
-rw-r--r-- | drivers/pnp/pnpbios/core.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c index 3ee5ed437385..6af2be2c1d67 100644 --- a/drivers/pnp/pnpbios/core.c +++ b/drivers/pnp/pnpbios/core.c @@ -318,7 +318,6 @@ static int __init insert_device(struct pnp_bios_node *node) { struct list_head *pos; struct pnp_dev *dev; - struct pnp_id *dev_id; char id[8]; /* check if the device is already added */ @@ -328,18 +327,11 @@ static int __init insert_device(struct pnp_bios_node *node) return -1; } - dev = kzalloc(sizeof(struct pnp_dev), GFP_KERNEL); - if (!dev) - return -1; - pnp_eisa_id_to_string(node->eisa_id & PNP_EISA_ID_MASK, id); - dev_id = pnp_add_id(dev, id); - if (!dev_id) { - kfree(dev); + dev = pnp_alloc_dev(&pnpbios_protocol, node->handle, id); + if (!dev) return -1; - } - dev->number = node->handle; pnpbios_parse_data_stream(dev, node); dev->active = pnp_is_active(dev); dev->flags = node->flags; @@ -352,7 +344,6 @@ static int __init insert_device(struct pnp_bios_node *node) dev->capabilities |= PNP_WRITE; if (dev->flags & PNPBIOS_REMOVABLE) dev->capabilities |= PNP_REMOVABLE; - dev->protocol = &pnpbios_protocol; /* clear out the damaged flags */ if (!dev->active) |