aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_pcmcia.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/ata/pata_pcmcia.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/ata/pata_pcmcia.c')
-rw-r--r--drivers/ata/pata_pcmcia.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 20982065a494..6e4d31d8d14e 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -150,7 +150,6 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
150 150
151 151
152struct pcmcia_config_check { 152struct pcmcia_config_check {
153 config_info_t conf;
154 unsigned long ctl_base; 153 unsigned long ctl_base;
155 int skip_vcc; 154 int skip_vcc;
156 int is_kme; 155 int is_kme;
@@ -159,6 +158,7 @@ struct pcmcia_config_check {
159static int pcmcia_check_one_config(struct pcmcia_device *pdev, 158static int pcmcia_check_one_config(struct pcmcia_device *pdev,
160 cistpl_cftable_entry_t *cfg, 159 cistpl_cftable_entry_t *cfg,
161 cistpl_cftable_entry_t *dflt, 160 cistpl_cftable_entry_t *dflt,
161 unsigned int vcc,
162 void *priv_data) 162 void *priv_data)
163{ 163{
164 struct pcmcia_config_check *stk = priv_data; 164 struct pcmcia_config_check *stk = priv_data;
@@ -166,12 +166,10 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
166 /* Check for matching Vcc, unless we're desperate */ 166 /* Check for matching Vcc, unless we're desperate */
167 if (!stk->skip_vcc) { 167 if (!stk->skip_vcc) {
168 if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { 168 if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) {
169 if (stk->conf.Vcc != 169 if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000)
170 cfg->vcc.param[CISTPL_POWER_VNOM] / 10000)
171 return -ENODEV; 170 return -ENODEV;
172 } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { 171 } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) {
173 if (stk->conf.Vcc != 172 if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000)
174 dflt->vcc.param[CISTPL_POWER_VNOM] / 10000)
175 return -ENODEV; 173 return -ENODEV;
176 } 174 }
177 } 175 }
@@ -257,10 +255,8 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
257 if (!stk) 255 if (!stk)
258 goto out1; 256 goto out1;
259 stk->is_kme = is_kme; 257 stk->is_kme = is_kme;
260
261 /* Not sure if this is right... look up the current Vcc */
262 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(pdev, &stk->conf));
263 stk->skip_vcc = io_base = ctl_base = 0; 258 stk->skip_vcc = io_base = ctl_base = 0;
259
264 if (pcmcia_loop_config(pdev, pcmcia_check_one_config, stk)) { 260 if (pcmcia_loop_config(pdev, pcmcia_check_one_config, stk)) {
265 stk->skip_vcc = 1; 261 stk->skip_vcc = 1;
266 if (pcmcia_loop_config(pdev, pcmcia_check_one_config, stk)) 262 if (pcmcia_loop_config(pdev, pcmcia_check_one_config, stk))