diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-04-28 18:33:57 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 03:22:17 -0400 |
commit | 068076d5517009654376ceda75ff44af0feb9b1d (patch) | |
tree | ea8b83c7898031b6b98b7019528e0366cac2b1c6 | |
parent | e436675f2a09ea389c1844507658f304924a2eca (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>
-rw-r--r-- | drivers/pnp/isapnp/core.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index 1949c18a7365..3a326f9305f6 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) | |||
817 | } | 817 | } |
818 | 818 | ||
819 | /* | 819 | /* |
820 | * Parse EISA id for ISA PnP card. | ||
821 | */ | ||
822 | static void isapnp_parse_card_id(struct pnp_card *card, unsigned short vendor, | ||
823 | unsigned short device) | ||
824 | { | ||
825 | char id[8]; | ||
826 | |||
827 | id[0] = 'A' + ((vendor >> 2) & 0x3f) - 1; | ||
828 | id[1] = 'A' + (((vendor & 3) << 3) | ((vendor >> 13) & 7)) - 1; | ||
829 | id[2] = 'A' + ((vendor >> 8) & 0x1f) - 1; | ||
830 | id[3] = hex_asc((device >> 4) & 0x0f); | ||
831 | id[4] = hex_asc(device & 0x0f); | ||
832 | id[5] = hex_asc((device >> 12) & 0x0f); | ||
833 | id[6] = hex_asc((device >> 8) & 0x0f); | ||
834 | id[7] = '\0'; | ||
835 | |||
836 | pnp_add_card_id(card, id); | ||
837 | } | ||
838 | |||
839 | /* | ||
840 | * Build device list for all present ISA PnP devices. | 820 | * Build device list for all present ISA PnP devices. |
841 | */ | 821 | */ |
842 | static int __init isapnp_build_device_list(void) | 822 | static int __init isapnp_build_device_list(void) |
@@ -844,6 +824,8 @@ static int __init isapnp_build_device_list(void) | |||
844 | int csn; | 824 | int csn; |
845 | unsigned char header[9], checksum; | 825 | unsigned char header[9], checksum; |
846 | struct pnp_card *card; | 826 | struct pnp_card *card; |
827 | u32 eisa_id; | ||
828 | char id[8]; | ||
847 | 829 | ||
848 | isapnp_wait(); | 830 | isapnp_wait(); |
849 | isapnp_key(); | 831 | isapnp_key(); |
@@ -864,8 +846,10 @@ static int __init isapnp_build_device_list(void) | |||
864 | 846 | ||
865 | card->number = csn; | 847 | card->number = csn; |
866 | INIT_LIST_HEAD(&card->devices); | 848 | INIT_LIST_HEAD(&card->devices); |
867 | isapnp_parse_card_id(card, (header[1] << 8) | header[0], | 849 | eisa_id = header[0] | header[1] << 8 | |
868 | (header[3] << 8) | header[2]); | 850 | header[2] << 16 | header[3] << 24; |
851 | pnp_eisa_id_to_string(eisa_id, id); | ||
852 | pnp_add_card_id(card, id); | ||
869 | card->serial = | 853 | card->serial = |
870 | (header[7] << 24) | (header[6] << 16) | (header[5] << 8) | | 854 | (header[7] << 24) | (header[6] << 16) | (header[5] << 8) | |
871 | header[4]; | 855 | header[4]; |