aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pcmcia_resource.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/pcmcia/pcmcia_resource.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/pcmcia/pcmcia_resource.c')
-rw-r--r--drivers/pcmcia/pcmcia_resource.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 5ddfd46dea65..0cf3ef30625e 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -935,6 +935,7 @@ int pcmcia_loop_config(struct pcmcia_device *p_dev,
935 int (*conf_check) (struct pcmcia_device *p_dev, 935 int (*conf_check) (struct pcmcia_device *p_dev,
936 cistpl_cftable_entry_t *cfg, 936 cistpl_cftable_entry_t *cfg,
937 cistpl_cftable_entry_t *dflt, 937 cistpl_cftable_entry_t *dflt,
938 unsigned int vcc,
938 void *priv_data), 939 void *priv_data),
939 void *priv_data) 940 void *priv_data)
940{ 941{
@@ -942,11 +943,15 @@ int pcmcia_loop_config(struct pcmcia_device *p_dev,
942 943
943 tuple_t *tuple; 944 tuple_t *tuple;
944 int ret = -ENODEV; 945 int ret = -ENODEV;
946 unsigned int vcc;
945 947
946 cfg_mem = kzalloc(sizeof(struct pcmcia_cfg_mem), GFP_KERNEL); 948 cfg_mem = kzalloc(sizeof(struct pcmcia_cfg_mem), GFP_KERNEL);
947 if (cfg_mem == NULL) 949 if (cfg_mem == NULL)
948 return -ENOMEM; 950 return -ENOMEM;
949 951
952 /* get the current Vcc setting */
953 vcc = p_dev->socket->socket.Vcc;
954
950 tuple = &cfg_mem->tuple; 955 tuple = &cfg_mem->tuple;
951 tuple->TupleData = cfg_mem->buf; 956 tuple->TupleData = cfg_mem->buf;
952 tuple->TupleDataMax = 255; 957 tuple->TupleDataMax = 255;
@@ -969,7 +974,7 @@ int pcmcia_loop_config(struct pcmcia_device *p_dev,
969 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) 974 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
970 cfg_mem->dflt = *cfg; 975 cfg_mem->dflt = *cfg;
971 976
972 ret = conf_check(p_dev, cfg, &cfg_mem->dflt, priv_data); 977 ret = conf_check(p_dev, cfg, &cfg_mem->dflt, vcc, priv_data);
973 if (!ret) 978 if (!ret)
974 break; 979 break;
975 980