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>
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 5ddfd46..0cf3ef3 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -935,6 +935,7 @@
int (*conf_check) (struct pcmcia_device *p_dev,
cistpl_cftable_entry_t *cfg,
cistpl_cftable_entry_t *dflt,
+ unsigned int vcc,
void *priv_data),
void *priv_data)
{
@@ -942,11 +943,15 @@
tuple_t *tuple;
int ret = -ENODEV;
+ unsigned int vcc;
cfg_mem = kzalloc(sizeof(struct pcmcia_cfg_mem), GFP_KERNEL);
if (cfg_mem == NULL)
return -ENOMEM;
+ /* get the current Vcc setting */
+ vcc = p_dev->socket->socket.Vcc;
+
tuple = &cfg_mem->tuple;
tuple->TupleData = cfg_mem->buf;
tuple->TupleDataMax = 255;
@@ -969,7 +974,7 @@
if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
cfg_mem->dflt = *cfg;
- ret = conf_check(p_dev, cfg, &cfg_mem->dflt, priv_data);
+ ret = conf_check(p_dev, cfg, &cfg_mem->dflt, vcc, priv_data);
if (!ret)
break;