aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btuart_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2008-08-02 10:12:00 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2008-08-22 19:22:52 -0400
commitad913c11928f51abb6174f165db8d8d205b22e21 (patch)
treea8542c846afb4950a12f46b16c1eacfa2280971a /drivers/bluetooth/btuart_cs.c
parent8e2fc39ddea7fe8c6798837da282db88a09af793 (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/bluetooth/btuart_cs.c')
-rw-r--r--drivers/bluetooth/btuart_cs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 32017f96067c..17183125434f 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -610,16 +610,17 @@ static void btuart_detach(struct pcmcia_device *link)
610static int btuart_check_config(struct pcmcia_device *p_dev, 610static int btuart_check_config(struct pcmcia_device *p_dev,
611 cistpl_cftable_entry_t *cf, 611 cistpl_cftable_entry_t *cf,
612 cistpl_cftable_entry_t *dflt, 612 cistpl_cftable_entry_t *dflt,
613 unsigned int vcc,
613 void *priv_data) 614 void *priv_data)
614{ 615{
615 unsigned long try = (unsigned long) priv_data; 616 int *try = priv_data;
616 617
617 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) 618 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
618 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; 619 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
619 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && 620 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
620 (cf->io.win[0].base != 0)) { 621 (cf->io.win[0].base != 0)) {
621 p_dev->io.BasePort1 = cf->io.win[0].base; 622 p_dev->io.BasePort1 = cf->io.win[0].base;
622 p_dev->io.IOAddrLines = (try == 0) ? 16 : 623 p_dev->io.IOAddrLines = (*try == 0) ? 16 :
623 cf->io.flags & CISTPL_IO_LINES_MASK; 624 cf->io.flags & CISTPL_IO_LINES_MASK;
624 if (!pcmcia_request_io(p_dev, &p_dev->io)) 625 if (!pcmcia_request_io(p_dev, &p_dev->io))
625 return 0; 626 return 0;
@@ -630,6 +631,7 @@ static int btuart_check_config(struct pcmcia_device *p_dev,
630static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, 631static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
631 cistpl_cftable_entry_t *cf, 632 cistpl_cftable_entry_t *cf,
632 cistpl_cftable_entry_t *dflt, 633 cistpl_cftable_entry_t *dflt,
634 unsigned int vcc,
633 void *priv_data) 635 void *priv_data)
634{ 636{
635 static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; 637 static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
@@ -650,13 +652,12 @@ static int btuart_config(struct pcmcia_device *link)
650{ 652{
651 btuart_info_t *info = link->priv; 653 btuart_info_t *info = link->priv;
652 int i; 654 int i;
653 unsigned long try; 655 int try;
654 656
655 /* First pass: look for a config entry that looks normal. 657 /* First pass: look for a config entry that looks normal.
656 Two tries: without IO aliases, then with aliases */ 658 Two tries: without IO aliases, then with aliases */
657 for (try = 0; try < 2; try++) 659 for (try = 0; try < 2; try++)
658 if (!pcmcia_loop_config(link, btuart_check_config, 660 if (!pcmcia_loop_config(link, btuart_check_config, &try))
659 (void *) try))
660 goto found_port; 661 goto found_port;
661 662
662 /* Second pass: try to find an entry that isn't picky about 663 /* Second pass: try to find an entry that isn't picky about