summaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 16:33:57 -0600
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:17 -0400
commit068076d5517009654376ceda75ff44af0feb9b1d (patch)
treeea8b83c7898031b6b98b7019528e0366cac2b1c6 /drivers/pnp
parente436675f2a09ea389c1844507658f304924a2eca (diff)
ISAPNP: pull pnp_add_card_id() out of isapnp_parse_card_id()
Split the pnp_add_card_id() part from the PNPID conversion part so we can move the initial add_id() into the pnp_card allocation. This makes the PNPID conversion generic so we can use the same one for both devices and cards. 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')
-rw-r--r--drivers/pnp/isapnp/core.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index 1949c18a736..3a326f9305f 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -817,26 +817,6 @@ static unsigned char __init isapnp_checksum(unsigned char *data)
}
/*
- * Parse EISA id for ISA PnP card.
- */
-static void isapnp_parse_card_id(struct pnp_card *card, unsigned short vendor,
- unsigned short device)
-{
- char id[8];
-
- id[0] = 'A' + ((vendor >> 2) & 0x3f) - 1;
- id[1] = 'A' + (((vendor & 3) << 3) | ((vendor >> 13) & 7)) - 1;
- id[2] = 'A' + ((vendor >> 8) & 0x1f) - 1;
- id[3] = hex_asc((device >> 4) & 0x0f);
- id[4] = hex_asc(device & 0x0f);
- id[5] = hex_asc((device >> 12) & 0x0f);
- id[6] = hex_asc((device >> 8) & 0x0f);
- id[7] = '\0';
-
- pnp_add_card_id(card, id);
-}
-
-/*
* Build device list for all present ISA PnP devices.
*/
static int __init isapnp_build_device_list(void)
@@ -844,6 +824,8 @@ static int __init isapnp_build_device_list(void)
int csn;
unsigned char header[9], checksum;
struct pnp_card *card;
+ u32 eisa_id;
+ char id[8];
isapnp_wait();
isapnp_key();
@@ -864,8 +846,10 @@ static int __init isapnp_build_device_list(void)
card->number = csn;
INIT_LIST_HEAD(&card->devices);
- isapnp_parse_card_id(card, (header[1] << 8) | header[0],
- (header[3] << 8) | header[2]);
+ eisa_id = header[0] | header[1] << 8 |
+ header[2] << 16 | header[3] << 24;
+ pnp_eisa_id_to_string(eisa_id, id);
+ pnp_add_card_id(card, id);
card->serial =
(header[7] << 24) | (header[6] << 16) | (header[5] << 8) |
header[4];