From 772defc6292bae8b6db298476d1dabd22a99492b Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Mon, 28 Apr 2008 16:33:52 -0600 Subject: 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 Acked-By: Rene Herman Signed-off-by: Len Brown --- drivers/pnp/isapnp/core.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'drivers/pnp/isapnp') diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index dd67752a5828..10cade831433 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c @@ -44,6 +44,8 @@ #include #include +#include "../base.h" + #if 0 #define ISAPNP_REGION_OK #endif @@ -401,20 +403,16 @@ static void __init isapnp_skip_bytes(int count) static void isapnp_parse_id(struct pnp_dev *dev, unsigned short vendor, unsigned short device) { - struct pnp_id *id; + char id[8]; - if (!dev) - return; - id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL); - if (!id) - return; - sprintf(id->id, "%c%c%c%x%x%x%x", + sprintf(id, "%c%c%c%x%x%x%x", 'A' + ((vendor >> 2) & 0x3f) - 1, 'A' + (((vendor & 3) << 3) | ((vendor >> 13) & 7)) - 1, 'A' + ((vendor >> 8) & 0x1f) - 1, (device >> 4) & 0x0f, device & 0x0f, (device >> 12) & 0x0f, (device >> 8) & 0x0f); - pnp_add_id(id, dev); + + pnp_add_id(dev, id); } /* -- cgit v1.2.3