diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-02 10:12:00 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-22 19:22:52 -0400 |
commit | ad913c11928f51abb6174f165db8d8d205b22e21 (patch) | |
tree | a8542c846afb4950a12f46b16c1eacfa2280971a /drivers/net | |
parent | 8e2fc39ddea7fe8c6798837da282db88a09af793 (diff) |
pcmcia: pcmcia_config_loop() improvement by passing vcc
By passing the current Vcc setting to the pcmcia_config_loop callback
function, we can remove pcmcia_get_configuration_info() calls from many
drivers.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 1 | ||||
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 1 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/airo_cs.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/atmel_cs.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_cs.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco_cs.c | 28 | ||||
-rw-r--r-- | drivers/net/wireless/spectrum_cs.c | 28 |
9 files changed, 24 insertions, 63 deletions
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index c99dc5d54d19..061d889794c5 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -287,6 +287,7 @@ static int try_io_port(struct pcmcia_device *link) | |||
287 | static int axnet_configcheck(struct pcmcia_device *p_dev, | 287 | static int axnet_configcheck(struct pcmcia_device *p_dev, |
288 | cistpl_cftable_entry_t *cfg, | 288 | cistpl_cftable_entry_t *cfg, |
289 | cistpl_cftable_entry_t *dflt, | 289 | cistpl_cftable_entry_t *dflt, |
290 | unsigned int vcc, | ||
290 | void *priv_data) | 291 | void *priv_data) |
291 | { | 292 | { |
292 | int i; | 293 | int i; |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 10fc537804b0..aa17434faa0e 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -515,6 +515,7 @@ static int try_io_port(struct pcmcia_device *link) | |||
515 | static int pcnet_confcheck(struct pcmcia_device *p_dev, | 515 | static int pcnet_confcheck(struct pcmcia_device *p_dev, |
516 | cistpl_cftable_entry_t *cfg, | 516 | cistpl_cftable_entry_t *cfg, |
517 | cistpl_cftable_entry_t *dflt, | 517 | cistpl_cftable_entry_t *dflt, |
518 | unsigned int vcc, | ||
518 | void *priv_data) | 519 | void *priv_data) |
519 | { | 520 | { |
520 | int *has_shmem = priv_data; | 521 | int *has_shmem = priv_data; |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 05bca83c5e27..b3f2085ddca9 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -462,6 +462,7 @@ static int mhz_3288_power(struct pcmcia_device *link) | |||
462 | static int mhz_mfc_config_check(struct pcmcia_device *p_dev, | 462 | static int mhz_mfc_config_check(struct pcmcia_device *p_dev, |
463 | cistpl_cftable_entry_t *cf, | 463 | cistpl_cftable_entry_t *cf, |
464 | cistpl_cftable_entry_t *dflt, | 464 | cistpl_cftable_entry_t *dflt, |
465 | unsigned int vcc, | ||
465 | void *priv_data) | 466 | void *priv_data) |
466 | { | 467 | { |
467 | int k; | 468 | int k; |
@@ -653,6 +654,7 @@ static int mot_setup(struct pcmcia_device *link) | |||
653 | static int smc_configcheck(struct pcmcia_device *p_dev, | 654 | static int smc_configcheck(struct pcmcia_device *p_dev, |
654 | cistpl_cftable_entry_t *cf, | 655 | cistpl_cftable_entry_t *cf, |
655 | cistpl_cftable_entry_t *dflt, | 656 | cistpl_cftable_entry_t *dflt, |
657 | unsigned int vcc, | ||
656 | void *priv_data) | 658 | void *priv_data) |
657 | { | 659 | { |
658 | p_dev->io.BasePort1 = cf->io.win[0].base; | 660 | p_dev->io.BasePort1 = cf->io.win[0].base; |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index a16efa49b855..d97e6e917c3c 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -719,6 +719,7 @@ static int | |||
719 | xirc2ps_config_modem(struct pcmcia_device *p_dev, | 719 | xirc2ps_config_modem(struct pcmcia_device *p_dev, |
720 | cistpl_cftable_entry_t *cf, | 720 | cistpl_cftable_entry_t *cf, |
721 | cistpl_cftable_entry_t *dflt, | 721 | cistpl_cftable_entry_t *dflt, |
722 | unsigned int vcc, | ||
722 | void *priv_data) | 723 | void *priv_data) |
723 | { | 724 | { |
724 | unsigned int ioaddr; | 725 | unsigned int ioaddr; |
@@ -738,6 +739,7 @@ static int | |||
738 | xirc2ps_config_check(struct pcmcia_device *p_dev, | 739 | xirc2ps_config_check(struct pcmcia_device *p_dev, |
739 | cistpl_cftable_entry_t *cf, | 740 | cistpl_cftable_entry_t *cf, |
740 | cistpl_cftable_entry_t *dflt, | 741 | cistpl_cftable_entry_t *dflt, |
742 | unsigned int vcc, | ||
741 | void *priv_data) | 743 | void *priv_data) |
742 | { | 744 | { |
743 | int *pass = priv_data; | 745 | int *pass = priv_data; |
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index 657adf85ab77..fac1526e49aa 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c | |||
@@ -209,6 +209,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | |||
209 | static int airo_cs_config_check(struct pcmcia_device *p_dev, | 209 | static int airo_cs_config_check(struct pcmcia_device *p_dev, |
210 | cistpl_cftable_entry_t *cfg, | 210 | cistpl_cftable_entry_t *cfg, |
211 | cistpl_cftable_entry_t *dflt, | 211 | cistpl_cftable_entry_t *dflt, |
212 | unsigned int vcc, | ||
212 | void *priv_data) | 213 | void *priv_data) |
213 | { | 214 | { |
214 | win_req_t *req = priv_data; | 215 | win_req_t *req = priv_data; |
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index c71aae992ecc..4830d51900a3 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c | |||
@@ -227,6 +227,7 @@ static int card_present(void *arg) | |||
227 | static int atmel_config_check(struct pcmcia_device *p_dev, | 227 | static int atmel_config_check(struct pcmcia_device *p_dev, |
228 | cistpl_cftable_entry_t *cfg, | 228 | cistpl_cftable_entry_t *cfg, |
229 | cistpl_cftable_entry_t *dflt, | 229 | cistpl_cftable_entry_t *dflt, |
230 | unsigned int vcc, | ||
230 | void *priv_data) | 231 | void *priv_data) |
231 | { | 232 | { |
232 | if (cfg->index == 0) | 233 | if (cfg->index == 0) |
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index f9595ca71a06..c768d42d5177 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c | |||
@@ -536,17 +536,12 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | |||
536 | /* run after a CARD_INSERTION event is received to configure the PCMCIA | 536 | /* run after a CARD_INSERTION event is received to configure the PCMCIA |
537 | * socket and make the device available to the system */ | 537 | * socket and make the device available to the system */ |
538 | 538 | ||
539 | struct prism2_config_data { | ||
540 | config_info_t conf; | ||
541 | }; | ||
542 | |||
543 | static int prism2_config_check(struct pcmcia_device *p_dev, | 539 | static int prism2_config_check(struct pcmcia_device *p_dev, |
544 | cistpl_cftable_entry_t *cfg, | 540 | cistpl_cftable_entry_t *cfg, |
545 | cistpl_cftable_entry_t *dflt, | 541 | cistpl_cftable_entry_t *dflt, |
542 | unsigned int vcc, | ||
546 | void *priv_data) | 543 | void *priv_data) |
547 | { | 544 | { |
548 | struct prism2_config_data *cfg_mem = priv_data; | ||
549 | |||
550 | if (cfg->index == 0) | 545 | if (cfg->index == 0) |
551 | return -ENODEV; | 546 | return -ENODEV; |
552 | 547 | ||
@@ -562,14 +557,14 @@ static int prism2_config_check(struct pcmcia_device *p_dev, | |||
562 | /* Use power settings for Vcc and Vpp if present */ | 557 | /* Use power settings for Vcc and Vpp if present */ |
563 | /* Note that the CIS values need to be rescaled */ | 558 | /* Note that the CIS values need to be rescaled */ |
564 | if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { | 559 | if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { |
565 | if (cfg_mem->conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / | 560 | if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / |
566 | 10000 && !ignore_cis_vcc) { | 561 | 10000 && !ignore_cis_vcc) { |
567 | PDEBUG(DEBUG_EXTRA, " Vcc mismatch - skipping" | 562 | PDEBUG(DEBUG_EXTRA, " Vcc mismatch - skipping" |
568 | " this entry\n"); | 563 | " this entry\n"); |
569 | return -ENODEV; | 564 | return -ENODEV; |
570 | } | 565 | } |
571 | } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { | 566 | } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { |
572 | if (cfg_mem->conf.Vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / | 567 | if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / |
573 | 10000 && !ignore_cis_vcc) { | 568 | 10000 && !ignore_cis_vcc) { |
574 | PDEBUG(DEBUG_EXTRA, " Vcc (default) mismatch " | 569 | PDEBUG(DEBUG_EXTRA, " Vcc (default) mismatch " |
575 | "- skipping this entry\n"); | 570 | "- skipping this entry\n"); |
@@ -627,7 +622,6 @@ static int prism2_config(struct pcmcia_device *link) | |||
627 | { | 622 | { |
628 | struct net_device *dev; | 623 | struct net_device *dev; |
629 | struct hostap_interface *iface; | 624 | struct hostap_interface *iface; |
630 | struct prism2_config_data *cfg_mem; | ||
631 | local_info_t *local; | 625 | local_info_t *local; |
632 | int ret = 1; | 626 | int ret = 1; |
633 | int last_fn, last_ret; | 627 | int last_fn, last_ret; |
@@ -635,21 +629,14 @@ static int prism2_config(struct pcmcia_device *link) | |||
635 | 629 | ||
636 | PDEBUG(DEBUG_FLOW, "prism2_config()\n"); | 630 | PDEBUG(DEBUG_FLOW, "prism2_config()\n"); |
637 | 631 | ||
638 | cfg_mem = kzalloc(sizeof(struct prism2_config_data), GFP_KERNEL); | ||
639 | if (!cfg_mem) | ||
640 | return -ENOMEM; | ||
641 | |||
642 | hw_priv = kzalloc(sizeof(*hw_priv), GFP_KERNEL); | 632 | hw_priv = kzalloc(sizeof(*hw_priv), GFP_KERNEL); |
643 | if (hw_priv == NULL) { | 633 | if (hw_priv == NULL) { |
644 | ret = -ENOMEM; | 634 | ret = -ENOMEM; |
645 | goto failed; | 635 | goto failed; |
646 | } | 636 | } |
647 | 637 | ||
648 | CS_CHECK(GetConfigurationInfo, | ||
649 | pcmcia_get_configuration_info(link, &cfg_mem->conf)); | ||
650 | |||
651 | /* Look for an appropriate configuration table entry in the CIS */ | 638 | /* Look for an appropriate configuration table entry in the CIS */ |
652 | last_ret = pcmcia_loop_config(link, prism2_config_check, cfg_mem); | 639 | last_ret = pcmcia_loop_config(link, prism2_config_check, NULL); |
653 | if (last_ret) { | 640 | if (last_ret) { |
654 | if (!ignore_cis_vcc) | 641 | if (!ignore_cis_vcc) |
655 | printk(KERN_ERR "GetNextTuple(): No matching " | 642 | printk(KERN_ERR "GetNextTuple(): No matching " |
@@ -724,7 +711,6 @@ static int prism2_config(struct pcmcia_device *link) | |||
724 | if (ret == 0 && local->ddev) | 711 | if (ret == 0 && local->ddev) |
725 | strcpy(hw_priv->node.dev_name, local->ddev->name); | 712 | strcpy(hw_priv->node.dev_name, local->ddev->name); |
726 | } | 713 | } |
727 | kfree(cfg_mem); | ||
728 | return ret; | 714 | return ret; |
729 | 715 | ||
730 | cs_failed: | 716 | cs_failed: |
@@ -732,7 +718,6 @@ static int prism2_config(struct pcmcia_device *link) | |||
732 | 718 | ||
733 | failed: | 719 | failed: |
734 | kfree(hw_priv); | 720 | kfree(hw_priv); |
735 | kfree(cfg_mem); | ||
736 | prism2_release((u_long)link); | 721 | prism2_release((u_long)link); |
737 | return ret; | 722 | return ret; |
738 | } | 723 | } |
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c index 8a367f96db37..c7b57d9d499d 100644 --- a/drivers/net/wireless/orinoco_cs.c +++ b/drivers/net/wireless/orinoco_cs.c | |||
@@ -164,31 +164,26 @@ static void orinoco_cs_detach(struct pcmcia_device *link) | |||
164 | last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \ | 164 | last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \ |
165 | } while (0) | 165 | } while (0) |
166 | 166 | ||
167 | struct orinoco_cs_config_data { | ||
168 | config_info_t conf; | ||
169 | }; | ||
170 | |||
171 | static int orinoco_cs_config_check(struct pcmcia_device *p_dev, | 167 | static int orinoco_cs_config_check(struct pcmcia_device *p_dev, |
172 | cistpl_cftable_entry_t *cfg, | 168 | cistpl_cftable_entry_t *cfg, |
173 | cistpl_cftable_entry_t *dflt, | 169 | cistpl_cftable_entry_t *dflt, |
170 | unsigned int vcc, | ||
174 | void *priv_data) | 171 | void *priv_data) |
175 | { | 172 | { |
176 | struct orinoco_cs_config_data *cfg_mem = priv_data; | ||
177 | |||
178 | if (cfg->index == 0) | 173 | if (cfg->index == 0) |
179 | goto next_entry; | 174 | goto next_entry; |
180 | 175 | ||
181 | /* Use power settings for Vcc and Vpp if present */ | 176 | /* Use power settings for Vcc and Vpp if present */ |
182 | /* Note that the CIS values need to be rescaled */ | 177 | /* Note that the CIS values need to be rescaled */ |
183 | if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { | 178 | if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { |
184 | if (cfg_mem->conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { | 179 | if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { |
185 | DEBUG(2, "spectrum_cs_config: Vcc mismatch (cfg_mem->conf.Vcc = %d, CIS = %d)\n", cfg_mem->conf.Vcc, cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); | 180 | DEBUG(2, "spectrum_cs_config: Vcc mismatch (vcc = %d, CIS = %d)\n", vcc, cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); |
186 | if (!ignore_cis_vcc) | 181 | if (!ignore_cis_vcc) |
187 | goto next_entry; | 182 | goto next_entry; |
188 | } | 183 | } |
189 | } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { | 184 | } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { |
190 | if (cfg_mem->conf.Vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { | 185 | if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { |
191 | DEBUG(2, "spectrum_cs_config: Vcc mismatch (cfg_mem->conf.Vcc = %d, CIS = %d)\n", cfg_mem->conf.Vcc, dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); | 186 | DEBUG(2, "spectrum_cs_config: Vcc mismatch (vcc = %d, CIS = %d)\n", vcc, dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); |
192 | if (!ignore_cis_vcc) | 187 | if (!ignore_cis_vcc) |
193 | goto next_entry; | 188 | goto next_entry; |
194 | } | 189 | } |
@@ -236,7 +231,6 @@ next_entry: | |||
236 | static int | 231 | static int |
237 | orinoco_cs_config(struct pcmcia_device *link) | 232 | orinoco_cs_config(struct pcmcia_device *link) |
238 | { | 233 | { |
239 | struct orinoco_cs_config_data *cfg_mem; | ||
240 | struct net_device *dev = link->priv; | 234 | struct net_device *dev = link->priv; |
241 | struct orinoco_private *priv = netdev_priv(dev); | 235 | struct orinoco_private *priv = netdev_priv(dev); |
242 | struct orinoco_pccard *card = priv->card; | 236 | struct orinoco_pccard *card = priv->card; |
@@ -244,14 +238,6 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
244 | int last_fn, last_ret; | 238 | int last_fn, last_ret; |
245 | void __iomem *mem; | 239 | void __iomem *mem; |
246 | 240 | ||
247 | cfg_mem = kzalloc(sizeof(struct orinoco_cs_config_data), GFP_KERNEL); | ||
248 | if (!cfg_mem) | ||
249 | return -ENOMEM; | ||
250 | |||
251 | /* Look up the current Vcc */ | ||
252 | CS_CHECK(GetConfigurationInfo, | ||
253 | pcmcia_get_configuration_info(link, &cfg_mem->conf)); | ||
254 | |||
255 | /* | 241 | /* |
256 | * In this loop, we scan the CIS for configuration table | 242 | * In this loop, we scan the CIS for configuration table |
257 | * entries, each of which describes a valid card | 243 | * entries, each of which describes a valid card |
@@ -266,7 +252,7 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
266 | * and most client drivers will only use the CIS to fill in | 252 | * and most client drivers will only use the CIS to fill in |
267 | * implementation-defined details. | 253 | * implementation-defined details. |
268 | */ | 254 | */ |
269 | last_ret = pcmcia_loop_config(link, orinoco_cs_config_check, cfg_mem); | 255 | last_ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL); |
270 | if (last_ret) { | 256 | if (last_ret) { |
271 | if (!ignore_cis_vcc) | 257 | if (!ignore_cis_vcc) |
272 | printk(KERN_ERR PFX "GetNextTuple(): No matching " | 258 | printk(KERN_ERR PFX "GetNextTuple(): No matching " |
@@ -324,7 +310,6 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
324 | "0x%04x-0x%04x\n", dev->name, dev->dev.parent->bus_id, | 310 | "0x%04x-0x%04x\n", dev->name, dev->dev.parent->bus_id, |
325 | link->irq.AssignedIRQ, link->io.BasePort1, | 311 | link->irq.AssignedIRQ, link->io.BasePort1, |
326 | link->io.BasePort1 + link->io.NumPorts1 - 1); | 312 | link->io.BasePort1 + link->io.NumPorts1 - 1); |
327 | kfree(cfg_mem); | ||
328 | return 0; | 313 | return 0; |
329 | 314 | ||
330 | cs_failed: | 315 | cs_failed: |
@@ -332,7 +317,6 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
332 | 317 | ||
333 | failed: | 318 | failed: |
334 | orinoco_cs_release(link); | 319 | orinoco_cs_release(link); |
335 | kfree(cfg_mem); | ||
336 | return -ENODEV; | 320 | return -ENODEV; |
337 | } /* orinoco_cs_config */ | 321 | } /* orinoco_cs_config */ |
338 | 322 | ||
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c index e28878dfaba3..d7e9d9c3042c 100644 --- a/drivers/net/wireless/spectrum_cs.c +++ b/drivers/net/wireless/spectrum_cs.c | |||
@@ -633,31 +633,26 @@ static void spectrum_cs_detach(struct pcmcia_device *link) | |||
633 | * device available to the system. | 633 | * device available to the system. |
634 | */ | 634 | */ |
635 | 635 | ||
636 | struct spectrum_cs_config_data { | ||
637 | config_info_t conf; | ||
638 | }; | ||
639 | |||
640 | static int spectrum_cs_config_check(struct pcmcia_device *p_dev, | 636 | static int spectrum_cs_config_check(struct pcmcia_device *p_dev, |
641 | cistpl_cftable_entry_t *cfg, | 637 | cistpl_cftable_entry_t *cfg, |
642 | cistpl_cftable_entry_t *dflt, | 638 | cistpl_cftable_entry_t *dflt, |
639 | unsigned int vcc, | ||
643 | void *priv_data) | 640 | void *priv_data) |
644 | { | 641 | { |
645 | struct spectrum_cs_config_data *cfg_mem = priv_data; | ||
646 | |||
647 | if (cfg->index == 0) | 642 | if (cfg->index == 0) |
648 | goto next_entry; | 643 | goto next_entry; |
649 | 644 | ||
650 | /* Use power settings for Vcc and Vpp if present */ | 645 | /* Use power settings for Vcc and Vpp if present */ |
651 | /* Note that the CIS values need to be rescaled */ | 646 | /* Note that the CIS values need to be rescaled */ |
652 | if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { | 647 | if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { |
653 | if (cfg_mem->conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { | 648 | if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { |
654 | DEBUG(2, "spectrum_cs_config: Vcc mismatch (cfg_mem->conf.Vcc = %d, CIS = %d)\n", cfg_mem->conf.Vcc, cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); | 649 | DEBUG(2, "spectrum_cs_config: Vcc mismatch (vcc = %d, CIS = %d)\n", vcc, cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); |
655 | if (!ignore_cis_vcc) | 650 | if (!ignore_cis_vcc) |
656 | goto next_entry; | 651 | goto next_entry; |
657 | } | 652 | } |
658 | } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { | 653 | } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { |
659 | if (cfg_mem->conf.Vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { | 654 | if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { |
660 | DEBUG(2, "spectrum_cs_config: Vcc mismatch (cfg_mem->conf.Vcc = %d, CIS = %d)\n", cfg_mem->conf.Vcc, dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); | 655 | DEBUG(2, "spectrum_cs_config: Vcc mismatch (vcc = %d, CIS = %d)\n", vcc, dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); |
661 | if (!ignore_cis_vcc) | 656 | if (!ignore_cis_vcc) |
662 | goto next_entry; | 657 | goto next_entry; |
663 | } | 658 | } |
@@ -705,7 +700,6 @@ next_entry: | |||
705 | static int | 700 | static int |
706 | spectrum_cs_config(struct pcmcia_device *link) | 701 | spectrum_cs_config(struct pcmcia_device *link) |
707 | { | 702 | { |
708 | struct spectrum_cs_config_data *cfg_mem; | ||
709 | struct net_device *dev = link->priv; | 703 | struct net_device *dev = link->priv; |
710 | struct orinoco_private *priv = netdev_priv(dev); | 704 | struct orinoco_private *priv = netdev_priv(dev); |
711 | struct orinoco_pccard *card = priv->card; | 705 | struct orinoco_pccard *card = priv->card; |
@@ -713,14 +707,6 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
713 | int last_fn, last_ret; | 707 | int last_fn, last_ret; |
714 | void __iomem *mem; | 708 | void __iomem *mem; |
715 | 709 | ||
716 | cfg_mem = kzalloc(sizeof(struct spectrum_cs_config_data), GFP_KERNEL); | ||
717 | if (!cfg_mem) | ||
718 | return -ENOMEM; | ||
719 | |||
720 | /* Look up the current Vcc */ | ||
721 | CS_CHECK(GetConfigurationInfo, | ||
722 | pcmcia_get_configuration_info(link, &cfg_mem->conf)); | ||
723 | |||
724 | /* | 710 | /* |
725 | * In this loop, we scan the CIS for configuration table | 711 | * In this loop, we scan the CIS for configuration table |
726 | * entries, each of which describes a valid card | 712 | * entries, each of which describes a valid card |
@@ -735,7 +721,7 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
735 | * and most client drivers will only use the CIS to fill in | 721 | * and most client drivers will only use the CIS to fill in |
736 | * implementation-defined details. | 722 | * implementation-defined details. |
737 | */ | 723 | */ |
738 | last_ret = pcmcia_loop_config(link, spectrum_cs_config_check, cfg_mem); | 724 | last_ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL); |
739 | if (last_ret) { | 725 | if (last_ret) { |
740 | if (!ignore_cis_vcc) | 726 | if (!ignore_cis_vcc) |
741 | printk(KERN_ERR PFX "GetNextTuple(): No matching " | 727 | printk(KERN_ERR PFX "GetNextTuple(): No matching " |
@@ -799,7 +785,6 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
799 | link->irq.AssignedIRQ, link->io.BasePort1, | 785 | link->irq.AssignedIRQ, link->io.BasePort1, |
800 | link->io.BasePort1 + link->io.NumPorts1 - 1); | 786 | link->io.BasePort1 + link->io.NumPorts1 - 1); |
801 | 787 | ||
802 | kfree(cfg_mem); | ||
803 | return 0; | 788 | return 0; |
804 | 789 | ||
805 | cs_failed: | 790 | cs_failed: |
@@ -807,7 +792,6 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
807 | 792 | ||
808 | failed: | 793 | failed: |
809 | spectrum_cs_release(link); | 794 | spectrum_cs_release(link); |
810 | kfree(cfg_mem); | ||
811 | return -ENODEV; | 795 | return -ENODEV; |
812 | } /* spectrum_cs_config */ | 796 | } /* spectrum_cs_config */ |
813 | 797 | ||