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/telephony/ixj_pcmcia.c | |
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/telephony/ixj_pcmcia.c')
-rw-r--r-- | drivers/telephony/ixj_pcmcia.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c index ba2c7a2125a0..b41df211b786 100644 --- a/drivers/telephony/ixj_pcmcia.c +++ b/drivers/telephony/ixj_pcmcia.c | |||
@@ -126,10 +126,9 @@ static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) | |||
126 | 126 | ||
127 | static int ixj_config_check(struct pcmcia_device *p_dev, | 127 | static int ixj_config_check(struct pcmcia_device *p_dev, |
128 | cistpl_cftable_entry_t *cfg, | 128 | cistpl_cftable_entry_t *cfg, |
129 | cistpl_cftable_entry_t *dflt, | ||
129 | void *priv_data) | 130 | void *priv_data) |
130 | { | 131 | { |
131 | cistpl_cftable_entry_t *dflt = priv_data; | ||
132 | |||
133 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 132 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
134 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 133 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
135 | p_dev->io.BasePort1 = io->win[0].base; | 134 | p_dev->io.BasePort1 = io->win[0].base; |
@@ -138,10 +137,7 @@ static int ixj_config_check(struct pcmcia_device *p_dev, | |||
138 | p_dev->io.BasePort2 = io->win[1].base; | 137 | p_dev->io.BasePort2 = io->win[1].base; |
139 | p_dev->io.NumPorts2 = io->win[1].len; | 138 | p_dev->io.NumPorts2 = io->win[1].len; |
140 | } | 139 | } |
141 | if (pcmcia_request_io(p_dev, &p_dev->io)) { | 140 | if (!pcmcia_request_io(p_dev, &p_dev->io)) |
142 | if (cfg->flags & CISTPL_CFTABLE_DEFAULT) | ||
143 | *dflt = *cfg; | ||
144 | } else | ||
145 | return 0; | 141 | return 0; |
146 | } | 142 | } |
147 | return -ENODEV; | 143 | return -ENODEV; |