diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-02 09:30:31 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-22 19:22:00 -0400 |
commit | 8e2fc39ddea7fe8c6798837da282db88a09af793 (patch) | |
tree | 7cba37b5b86f4ff25562012a14e29424e3872de0 /drivers/pcmcia | |
parent | 498ac1899b62626bf6879a251d75c22ec564c559 (diff) |
pcmcia: pcmcia_config_loop() default CIS entry handling
Many drivers use the default CIS entry within their pcmcia_config_loop()
callback function. Therefore, factor the default CIS entry handling out.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index ba34ac8876ff..5ddfd46dea65 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
@@ -915,6 +915,7 @@ struct pcmcia_cfg_mem { | |||
915 | tuple_t tuple; | 915 | tuple_t tuple; |
916 | cisparse_t parse; | 916 | cisparse_t parse; |
917 | u8 buf[256]; | 917 | u8 buf[256]; |
918 | cistpl_cftable_entry_t dflt; | ||
918 | }; | 919 | }; |
919 | 920 | ||
920 | /** | 921 | /** |
@@ -933,10 +934,12 @@ struct pcmcia_cfg_mem { | |||
933 | int pcmcia_loop_config(struct pcmcia_device *p_dev, | 934 | int pcmcia_loop_config(struct pcmcia_device *p_dev, |
934 | int (*conf_check) (struct pcmcia_device *p_dev, | 935 | int (*conf_check) (struct pcmcia_device *p_dev, |
935 | cistpl_cftable_entry_t *cfg, | 936 | cistpl_cftable_entry_t *cfg, |
937 | cistpl_cftable_entry_t *dflt, | ||
936 | void *priv_data), | 938 | void *priv_data), |
937 | void *priv_data) | 939 | void *priv_data) |
938 | { | 940 | { |
939 | struct pcmcia_cfg_mem *cfg_mem; | 941 | struct pcmcia_cfg_mem *cfg_mem; |
942 | |||
940 | tuple_t *tuple; | 943 | tuple_t *tuple; |
941 | int ret = -ENODEV; | 944 | int ret = -ENODEV; |
942 | 945 | ||
@@ -963,8 +966,10 @@ int pcmcia_loop_config(struct pcmcia_device *p_dev, | |||
963 | 966 | ||
964 | /* default values */ | 967 | /* default values */ |
965 | p_dev->conf.ConfigIndex = cfg->index; | 968 | p_dev->conf.ConfigIndex = cfg->index; |
969 | if (cfg->flags & CISTPL_CFTABLE_DEFAULT) | ||
970 | cfg_mem->dflt = *cfg; | ||
966 | 971 | ||
967 | ret = conf_check(p_dev, cfg, priv_data); | 972 | ret = conf_check(p_dev, cfg, &cfg_mem->dflt, priv_data); |
968 | if (!ret) | 973 | if (!ret) |
969 | break; | 974 | break; |
970 | 975 | ||