diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-04-28 18:33:52 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 03:22:16 -0400 |
commit | 772defc6292bae8b6db298476d1dabd22a99492b (patch) | |
tree | b973807f7f65f6d59e8a273ff80ab3d312e71dc3 /drivers/pnp/pnpbios | |
parent | 1692b27bf37826f85f9c12f8468848885643532a (diff) |
PNP: change pnp_add_id() to allocate its own pnp_id structures
This moves some of the pnp_id knowledge out of the backends and into
the PNP core.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/pnpbios')
-rw-r--r-- | drivers/pnp/pnpbios/core.c | 6 | ||||
-rw-r--r-- | drivers/pnp/pnpbios/rsparser.c | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c index 2a5353bceb24..2d592aea0aa7 100644 --- a/drivers/pnp/pnpbios/core.c +++ b/drivers/pnp/pnpbios/core.c | |||
@@ -332,16 +332,14 @@ static int __init insert_device(struct pnp_bios_node *node) | |||
332 | if (!dev) | 332 | if (!dev) |
333 | return -1; | 333 | return -1; |
334 | 334 | ||
335 | dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL); | 335 | pnpid32_to_pnpid(node->eisa_id, id); |
336 | dev_id = pnp_add_id(dev, id); | ||
336 | if (!dev_id) { | 337 | if (!dev_id) { |
337 | kfree(dev); | 338 | kfree(dev); |
338 | return -1; | 339 | return -1; |
339 | } | 340 | } |
340 | 341 | ||
341 | dev->number = node->handle; | 342 | dev->number = node->handle; |
342 | pnpid32_to_pnpid(node->eisa_id, id); | ||
343 | memcpy(dev_id->id, id, 7); | ||
344 | pnp_add_id(dev_id, dev); | ||
345 | pnpbios_parse_data_stream(dev, node); | 343 | pnpbios_parse_data_stream(dev, node); |
346 | dev->active = pnp_is_active(dev); | 344 | dev->active = pnp_is_active(dev); |
347 | dev->flags = node->flags; | 345 | dev->flags = node->flags; |
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index caade3531416..dbc88412c12e 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c | |||
@@ -16,6 +16,7 @@ inline void pcibios_penalize_isa_irq(int irq, int active) | |||
16 | } | 16 | } |
17 | #endif /* CONFIG_PCI */ | 17 | #endif /* CONFIG_PCI */ |
18 | 18 | ||
19 | #include "../base.h" | ||
19 | #include "pnpbios.h" | 20 | #include "pnpbios.h" |
20 | 21 | ||
21 | /* standard resource tags */ | 22 | /* standard resource tags */ |
@@ -548,13 +549,11 @@ static unsigned char *pnpbios_parse_compatible_ids(unsigned char *p, | |||
548 | case SMALL_TAG_COMPATDEVID: /* compatible ID */ | 549 | case SMALL_TAG_COMPATDEVID: /* compatible ID */ |
549 | if (len != 4) | 550 | if (len != 4) |
550 | goto len_err; | 551 | goto len_err; |
551 | dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL); | ||
552 | if (!dev_id) | ||
553 | return NULL; | ||
554 | pnpid32_to_pnpid(p[1] | p[2] << 8 | p[3] << 16 | p[4] << | 552 | pnpid32_to_pnpid(p[1] | p[2] << 8 | p[3] << 16 | p[4] << |
555 | 24, id); | 553 | 24, id); |
556 | memcpy(&dev_id->id, id, 7); | 554 | dev_id = pnp_add_id(dev, id); |
557 | pnp_add_id(dev_id, dev); | 555 | if (!dev_id) |
556 | return NULL; | ||
558 | break; | 557 | break; |
559 | 558 | ||
560 | case SMALL_TAG_END: | 559 | case SMALL_TAG_END: |