diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-06-04 12:06:13 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-12-04 20:09:21 -0500 |
commit | a9606fd39083478bef313c0e3b77bc065e39e36e (patch) | |
tree | d9ee62f811e557671fad5cecf669f93300b6c57a /drivers/telephony/ixj_pcmcia.c | |
parent | efd50585e2ff9bd60e044fda7764d323010a7fe4 (diff) |
[PATCH] pcmcia: remove prod_id indirection
As we read out the product information strings (VERS_1) from the PCMCIA device
in the PCMCIA core, and device drivers can access those reliably in struct
pcmcia_device's fields prod_id[], remove additional product information string
detection logic from PCMCIA device drivers.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/telephony/ixj_pcmcia.c')
-rw-r--r-- | drivers/telephony/ixj_pcmcia.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c index dda0ca45d904..3f88978d5aee 100644 --- a/drivers/telephony/ixj_pcmcia.c +++ b/drivers/telephony/ixj_pcmcia.c | |||
@@ -69,25 +69,21 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | |||
69 | 69 | ||
70 | static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) | 70 | static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) |
71 | { | 71 | { |
72 | tuple_t tuple; | ||
73 | u_short buf[128]; | ||
74 | char *str; | 72 | char *str; |
75 | int last_ret, last_fn, i, place; | 73 | int i, place; |
76 | DEBUG(0, "ixj_get_serial(0x%p)\n", link); | 74 | DEBUG(0, "ixj_get_serial(0x%p)\n", link); |
77 | tuple.TupleData = (cisdata_t *) buf; | 75 | |
78 | tuple.TupleOffset = 0; | 76 | str = link->prod_id[0]; |
79 | tuple.TupleDataMax = 80; | 77 | if (!str) |
80 | tuple.Attributes = 0; | 78 | goto cs_failed; |
81 | tuple.DesiredTuple = CISTPL_VERS_1; | ||
82 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
83 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
84 | str = (char *) buf; | ||
85 | printk("PCMCIA Version %d.%d\n", str[0], str[1]); | ||
86 | str += 2; | ||
87 | printk("%s", str); | 79 | printk("%s", str); |
88 | str = str + strlen(str) + 1; | 80 | str = link->prod_id[1]; |
81 | if (!str) | ||
82 | goto cs_failed; | ||
89 | printk(" %s", str); | 83 | printk(" %s", str); |
90 | str = str + strlen(str) + 1; | 84 | str = link->prod_id[2]; |
85 | if (!str) | ||
86 | goto cs_failed; | ||
91 | place = 1; | 87 | place = 1; |
92 | for (i = strlen(str) - 1; i >= 0; i--) { | 88 | for (i = strlen(str) - 1; i >= 0; i--) { |
93 | switch (str[i]) { | 89 | switch (str[i]) { |
@@ -122,7 +118,9 @@ static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) | |||
122 | } | 118 | } |
123 | place = place * 0x10; | 119 | place = place * 0x10; |
124 | } | 120 | } |
125 | str = str + strlen(str) + 1; | 121 | str = link->prod_id[3]; |
122 | if (!str) | ||
123 | goto cs_failed; | ||
126 | printk(" version %s\n", str); | 124 | printk(" version %s\n", str); |
127 | cs_failed: | 125 | cs_failed: |
128 | return; | 126 | return; |