diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-10-25 21:49:27 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-12-04 20:12:02 -0500 |
commit | af2b3b503ad1b071b66e1531caae252b4b95c847 (patch) | |
tree | 600785af3af4a79978f688fa35e19ab900db264b /drivers/isdn | |
parent | a9606fd39083478bef313c0e3b77bc065e39e36e (diff) |
[PATCH] pcmcia: conf.ConfigBase and conf.Present consolidation
struct pcmcia_device *p_dev->conf.ConfigBase and .Present are set in almost
all PCMICA driver right at the beginning, using the same calls but slightly
different implementations. Unfiy this in the PCMCIA core.
Includes a small bugfix ("drivers/net/pcmcia/xirc2ps_cs.c: remove unused
label") from and Signed-off-by Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/hardware/avm/avm_cs.c | 22 | ||||
-rw-r--r-- | drivers/isdn/hisax/avma1_cs.c | 22 | ||||
-rw-r--r-- | drivers/isdn/hisax/elsa_cs.c | 17 | ||||
-rw-r--r-- | drivers/isdn/hisax/sedlbauer_cs.c | 10 | ||||
-rw-r--r-- | drivers/isdn/hisax/teles_cs.c | 17 |
5 files changed, 0 insertions, 88 deletions
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c index db3755b28f53..fd5d7364a487 100644 --- a/drivers/isdn/hardware/avm/avm_cs.c +++ b/drivers/isdn/hardware/avm/avm_cs.c | |||
@@ -194,28 +194,6 @@ static int avmcs_config(struct pcmcia_device *link) | |||
194 | 194 | ||
195 | dev = link->priv; | 195 | dev = link->priv; |
196 | 196 | ||
197 | /* | ||
198 | This reads the card's CONFIG tuple to find its configuration | ||
199 | registers. | ||
200 | */ | ||
201 | do { | ||
202 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
203 | i = pcmcia_get_first_tuple(link, &tuple); | ||
204 | if (i != CS_SUCCESS) break; | ||
205 | tuple.TupleData = buf; | ||
206 | tuple.TupleDataMax = 64; | ||
207 | tuple.TupleOffset = 0; | ||
208 | i = pcmcia_get_tuple_data(link, &tuple); | ||
209 | if (i != CS_SUCCESS) break; | ||
210 | i = pcmcia_parse_tuple(link, &tuple, &parse); | ||
211 | if (i != CS_SUCCESS) break; | ||
212 | link->conf.ConfigBase = parse.config.base; | ||
213 | } while (0); | ||
214 | if (i != CS_SUCCESS) { | ||
215 | cs_error(link, ParseTuple, i); | ||
216 | return -ENODEV; | ||
217 | } | ||
218 | |||
219 | do { | 197 | do { |
220 | devname[0] = 0; | 198 | devname[0] = 0; |
221 | if (link->prod_id[1]) | 199 | if (link->prod_id[1]) |
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c index 40c9b026729c..876fec6c6be8 100644 --- a/drivers/isdn/hisax/avma1_cs.c +++ b/drivers/isdn/hisax/avma1_cs.c | |||
@@ -216,28 +216,6 @@ static int avma1cs_config(struct pcmcia_device *link) | |||
216 | 216 | ||
217 | DEBUG(0, "avma1cs_config(0x%p)\n", link); | 217 | DEBUG(0, "avma1cs_config(0x%p)\n", link); |
218 | 218 | ||
219 | /* | ||
220 | This reads the card's CONFIG tuple to find its configuration | ||
221 | registers. | ||
222 | */ | ||
223 | do { | ||
224 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
225 | i = pcmcia_get_first_tuple(link, &tuple); | ||
226 | if (i != CS_SUCCESS) break; | ||
227 | tuple.TupleData = buf; | ||
228 | tuple.TupleDataMax = 64; | ||
229 | tuple.TupleOffset = 0; | ||
230 | i = pcmcia_get_tuple_data(link, &tuple); | ||
231 | if (i != CS_SUCCESS) break; | ||
232 | i = pcmcia_parse_tuple(link, &tuple, &parse); | ||
233 | if (i != CS_SUCCESS) break; | ||
234 | link->conf.ConfigBase = parse.config.base; | ||
235 | } while (0); | ||
236 | if (i != CS_SUCCESS) { | ||
237 | cs_error(link, ParseTuple, i); | ||
238 | return -ENODEV; | ||
239 | } | ||
240 | |||
241 | do { | 219 | do { |
242 | devname[0] = 0; | 220 | devname[0] = 0; |
243 | if (link->prod_id[1]) | 221 | if (link->prod_id[1]) |
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c index e18e75be8ed3..4e180d210faa 100644 --- a/drivers/isdn/hisax/elsa_cs.c +++ b/drivers/isdn/hisax/elsa_cs.c | |||
@@ -242,23 +242,6 @@ static int elsa_cs_config(struct pcmcia_device *link) | |||
242 | DEBUG(0, "elsa_config(0x%p)\n", link); | 242 | DEBUG(0, "elsa_config(0x%p)\n", link); |
243 | dev = link->priv; | 243 | dev = link->priv; |
244 | 244 | ||
245 | /* | ||
246 | This reads the card's CONFIG tuple to find its configuration | ||
247 | registers. | ||
248 | */ | ||
249 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
250 | tuple.TupleData = (cisdata_t *)buf; | ||
251 | tuple.TupleDataMax = 255; | ||
252 | tuple.TupleOffset = 0; | ||
253 | tuple.Attributes = 0; | ||
254 | i = first_tuple(link, &tuple, &parse); | ||
255 | if (i != CS_SUCCESS) { | ||
256 | last_fn = ParseTuple; | ||
257 | goto cs_failed; | ||
258 | } | ||
259 | link->conf.ConfigBase = parse.config.base; | ||
260 | link->conf.Present = parse.config.rmask[0]; | ||
261 | |||
262 | tuple.TupleData = (cisdata_t *)buf; | 245 | tuple.TupleData = (cisdata_t *)buf; |
263 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; | 246 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; |
264 | tuple.Attributes = 0; | 247 | tuple.Attributes = 0; |
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index f9c14a2970bc..46ed65334c51 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c | |||
@@ -233,20 +233,10 @@ static int sedlbauer_config(struct pcmcia_device *link) | |||
233 | 233 | ||
234 | DEBUG(0, "sedlbauer_config(0x%p)\n", link); | 234 | DEBUG(0, "sedlbauer_config(0x%p)\n", link); |
235 | 235 | ||
236 | /* | ||
237 | This reads the card's CONFIG tuple to find its configuration | ||
238 | registers. | ||
239 | */ | ||
240 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
241 | tuple.Attributes = 0; | 236 | tuple.Attributes = 0; |
242 | tuple.TupleData = buf; | 237 | tuple.TupleData = buf; |
243 | tuple.TupleDataMax = sizeof(buf); | 238 | tuple.TupleDataMax = sizeof(buf); |
244 | tuple.TupleOffset = 0; | 239 | tuple.TupleOffset = 0; |
245 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
246 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
247 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
248 | link->conf.ConfigBase = parse.config.base; | ||
249 | link->conf.Present = parse.config.rmask[0]; | ||
250 | 240 | ||
251 | CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf)); | 241 | CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf)); |
252 | 242 | ||
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c index afcc2aeadb34..6b754f183796 100644 --- a/drivers/isdn/hisax/teles_cs.c +++ b/drivers/isdn/hisax/teles_cs.c | |||
@@ -232,23 +232,6 @@ static int teles_cs_config(struct pcmcia_device *link) | |||
232 | DEBUG(0, "teles_config(0x%p)\n", link); | 232 | DEBUG(0, "teles_config(0x%p)\n", link); |
233 | dev = link->priv; | 233 | dev = link->priv; |
234 | 234 | ||
235 | /* | ||
236 | This reads the card's CONFIG tuple to find its configuration | ||
237 | registers. | ||
238 | */ | ||
239 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
240 | tuple.TupleData = (cisdata_t *)buf; | ||
241 | tuple.TupleDataMax = 255; | ||
242 | tuple.TupleOffset = 0; | ||
243 | tuple.Attributes = 0; | ||
244 | i = first_tuple(link, &tuple, &parse); | ||
245 | if (i != CS_SUCCESS) { | ||
246 | last_fn = ParseTuple; | ||
247 | goto cs_failed; | ||
248 | } | ||
249 | link->conf.ConfigBase = parse.config.base; | ||
250 | link->conf.Present = parse.config.rmask[0]; | ||
251 | |||
252 | tuple.TupleData = (cisdata_t *)buf; | 235 | tuple.TupleData = (cisdata_t *)buf; |
253 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; | 236 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; |
254 | tuple.Attributes = 0; | 237 | tuple.Attributes = 0; |