aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/isapnp
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/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 @@
44#include <linux/mutex.h> 44#include <linux/mutex.h>
45#include <asm/io.h> 45#include <asm/io.h>
46 46
47#include "../base.h"
48
47#if 0 49#if 0
48#define ISAPNP_REGION_OK 50#define ISAPNP_REGION_OK
49#endif 51#endif
@@ -401,20 +403,16 @@ static void __init isapnp_skip_bytes(int count)
401static void isapnp_parse_id(struct pnp_dev *dev, unsigned short vendor, 403static void isapnp_parse_id(struct pnp_dev *dev, unsigned short vendor,
402 unsigned short device) 404 unsigned short device)
403{ 405{
404 struct pnp_id *id; 406 char id[8];
405 407
406 if (!dev) 408 sprintf(id, "%c%c%c%x%x%x%x",
407 return;
408 id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL);
409 if (!id)
410 return;
411 sprintf(id->id, "%c%c%c%x%x%x%x",
412 'A' + ((vendor >> 2) & 0x3f) - 1, 409 'A' + ((vendor >> 2) & 0x3f) - 1,
413 'A' + (((vendor & 3) << 3) | ((vendor >> 13) & 7)) - 1, 410 'A' + (((vendor & 3) << 3) | ((vendor >> 13) & 7)) - 1,
414 'A' + ((vendor >> 8) & 0x1f) - 1, 411 'A' + ((vendor >> 8) & 0x1f) - 1,
415 (device >> 4) & 0x0f, 412 (device >> 4) & 0x0f,
416 device & 0x0f, (device >> 12) & 0x0f, (device >> 8) & 0x0f); 413 device & 0x0f, (device >> 12) & 0x0f, (device >> 8) & 0x0f);
417 pnp_add_id(id, dev); 414
415 pnp_add_id(dev, id);
418} 416}
419 417
420/* 418/*