aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia
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/scsi/pcmcia
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/scsi/pcmcia')
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c1
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c1
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c8
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c1
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c1
5 files changed, 7 insertions, 5 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 2ed3077b826a..165ff884f48e 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -143,6 +143,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
143static int aha152x_config_check(struct pcmcia_device *p_dev, 143static int aha152x_config_check(struct pcmcia_device *p_dev,
144 cistpl_cftable_entry_t *cfg, 144 cistpl_cftable_entry_t *cfg,
145 cistpl_cftable_entry_t *dflt, 145 cistpl_cftable_entry_t *dflt,
146 unsigned int vcc,
146 void *priv_data) 147 void *priv_data)
147{ 148{
148 /* For New Media T&J, look for a SCSI window */ 149 /* For New Media T&J, look for a SCSI window */
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 2b6e92d7be07..06254f46a0dd 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -126,6 +126,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
126static int fdomain_config_check(struct pcmcia_device *p_dev, 126static int fdomain_config_check(struct pcmcia_device *p_dev,
127 cistpl_cftable_entry_t *cfg, 127 cistpl_cftable_entry_t *cfg,
128 cistpl_cftable_entry_t *dflt, 128 cistpl_cftable_entry_t *dflt,
129 unsigned int vcc,
129 void *priv_data) 130 void *priv_data)
130{ 131{
131 p_dev->io.BasePort1 = cfg->io.win[0].base; 132 p_dev->io.BasePort1 = cfg->io.win[0].base;
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index aa4523462578..7c19bf264873 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1611,12 +1611,12 @@ static void nsp_cs_detach(struct pcmcia_device *link)
1611struct nsp_cs_configdata { 1611struct nsp_cs_configdata {
1612 nsp_hw_data *data; 1612 nsp_hw_data *data;
1613 win_req_t req; 1613 win_req_t req;
1614 config_info_t conf;
1615}; 1614};
1616 1615
1617static int nsp_cs_config_check(struct pcmcia_device *p_dev, 1616static int nsp_cs_config_check(struct pcmcia_device *p_dev,
1618 cistpl_cftable_entry_t *cfg, 1617 cistpl_cftable_entry_t *cfg,
1619 cistpl_cftable_entry_t *dflt, 1618 cistpl_cftable_entry_t *dflt,
1619 unsigned int vcc,
1620 void *priv_data) 1620 void *priv_data)
1621{ 1621{
1622 struct nsp_cs_configdata *cfg_mem = priv_data; 1622 struct nsp_cs_configdata *cfg_mem = priv_data;
@@ -1633,10 +1633,10 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
1633 /* Use power settings for Vcc and Vpp if present */ 1633 /* Use power settings for Vcc and Vpp if present */
1634 /* Note that the CIS values need to be rescaled */ 1634 /* Note that the CIS values need to be rescaled */
1635 if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM)) { 1635 if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM)) {
1636 if (cfg_mem->conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM]/10000) 1636 if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM]/10000)
1637 return -ENODEV; 1637 return -ENODEV;
1638 else if (dflt->vcc.present & (1<<CISTPL_POWER_VNOM)) { 1638 else if (dflt->vcc.present & (1<<CISTPL_POWER_VNOM)) {
1639 if (cfg_mem->conf.Vcc != dflt->vcc.param[CISTPL_POWER_VNOM]/10000) 1639 if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM]/10000)
1640 return -ENODEV; 1640 return -ENODEV;
1641 } 1641 }
1642 1642
@@ -1719,8 +1719,6 @@ static int nsp_cs_config(struct pcmcia_device *link)
1719 return -ENOMEM; 1719 return -ENOMEM;
1720 cfg_mem->data = data; 1720 cfg_mem->data = data;
1721 1721
1722 /* Look up the current Vcc */
1723 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &cfg_mem->conf));
1724 ret = pcmcia_loop_config(link, nsp_cs_config_check, cfg_mem); 1722 ret = pcmcia_loop_config(link, nsp_cs_config_check, cfg_mem);
1725 goto cs_failed; 1723 goto cs_failed;
1726 1724
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index da6b3603198b..20c3e5e6d88a 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -198,6 +198,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
198static int qlogic_config_check(struct pcmcia_device *p_dev, 198static int qlogic_config_check(struct pcmcia_device *p_dev,
199 cistpl_cftable_entry_t *cfg, 199 cistpl_cftable_entry_t *cfg,
200 cistpl_cftable_entry_t *dflt, 200 cistpl_cftable_entry_t *dflt,
201 unsigned int vcc,
201 void *priv_data) 202 void *priv_data)
202{ 203{
203 p_dev->io.BasePort1 = cfg->io.win[0].base; 204 p_dev->io.BasePort1 = cfg->io.win[0].base;
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index eba193134dfa..b330c11a1752 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -703,6 +703,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
703static int SYM53C500_config_check(struct pcmcia_device *p_dev, 703static int SYM53C500_config_check(struct pcmcia_device *p_dev,
704 cistpl_cftable_entry_t *cfg, 704 cistpl_cftable_entry_t *cfg,
705 cistpl_cftable_entry_t *dflt, 705 cistpl_cftable_entry_t *dflt,
706 unsigned int vcc,
706 void *priv_data) 707 void *priv_data)
707{ 708{
708 p_dev->io.BasePort1 = cfg->io.win[0].base; 709 p_dev->io.BasePort1 = cfg->io.win[0].base;