pcmcia: pcmcia_config_loop() ConfigIndex unification
Almost all drivers set p_dev->conf.ConfigIndex to cfg->index in
the pcmcia_config_loop() callback function. Therefore, factor it out.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 9f054bc..ba34ac8 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -953,14 +953,18 @@
ret = pcmcia_get_first_tuple(p_dev, tuple);
while (!ret) {
+ cistpl_cftable_entry_t *cfg = &cfg_mem->parse.cftable_entry;
+
if (pcmcia_get_tuple_data(p_dev, tuple))
goto next_entry;
if (pcmcia_parse_tuple(p_dev, tuple, &cfg_mem->parse))
goto next_entry;
- ret = conf_check(p_dev, &cfg_mem->parse.cftable_entry,
- priv_data);
+ /* default values */
+ p_dev->conf.ConfigIndex = cfg->index;
+
+ ret = conf_check(p_dev, cfg, priv_data);
if (!ret)
break;