aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpbios/rsparser.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 18:33:52 -0400
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:16 -0400
commit772defc6292bae8b6db298476d1dabd22a99492b (patch)
treeb973807f7f65f6d59e8a273ff80ab3d312e71dc3 /drivers/pnp/pnpbios/rsparser.c
parent1692b27bf37826f85f9c12f8468848885643532a (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/rsparser.c')
-rw-r--r--drivers/pnp/pnpbios/rsparser.c9
1 files changed, 4 insertions, 5 deletions
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: