diff options
Diffstat (limited to 'drivers/telephony')
-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; |