summaryrefslogtreecommitdiff
path: root/drivers/pnp/isapnp
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 16:33:52 -0600
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:16 -0400
commit772defc6292bae8b6db298476d1dabd22a99492b (patch)
treeb973807f7f65f6d59e8a273ff80ab3d312e71dc3 /drivers/pnp/isapnp
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/isapnp')
-rw-r--r--drivers/pnp/isapnp/core.c14
1 files changed, 6 insertions, 8 deletions
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 <linux/mutex.h>
#include <asm/io.h>
+#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);
}
/*