diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-18 12:28:39 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-11-08 12:06:53 -0500 |
commit | aaa8cfdada648a6bae32f62df76cc60137a2b323 (patch) | |
tree | c610da3b895ed6fdcda058dc08962b0248624c98 /drivers/char/pcmcia/synclink_cs.c | |
parent | 7d2e8d00b47b973c92db4df7444d5e6d3bb945f9 (diff) |
pcmcia: use pcmcia_loop_config in misc pcmcia drivers
Use pcmcia_loop_config() in a few drivers missed during the first
round. On fmvj18x_cs.c it -- strangely -- only requries us to set
conf.ConfigIndex, which is done by the core, so include an empty
loop function which returns 0 unconditionally.
CC: David S. Miller <davem@davemloft.net>
CC: David Sterba <dsterba@suse.cz>
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
For the ipwireless part: Acked-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/char/pcmcia/synclink_cs.c')
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 64 |
1 files changed, 24 insertions, 40 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index caf6e4d19469..429b7313119b 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -575,55 +575,39 @@ static int mgslpc_probe(struct pcmcia_device *link) | |||
575 | #define CS_CHECK(fn, ret) \ | 575 | #define CS_CHECK(fn, ret) \ |
576 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 576 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
577 | 577 | ||
578 | static int mgslpc_ioprobe(struct pcmcia_device *p_dev, | ||
579 | cistpl_cftable_entry_t *cfg, | ||
580 | cistpl_cftable_entry_t *dflt, | ||
581 | unsigned int vcc, | ||
582 | void *priv_data) | ||
583 | { | ||
584 | if (cfg->io.nwin > 0) { | ||
585 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | ||
586 | if (!(cfg->io.flags & CISTPL_IO_8BIT)) | ||
587 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | ||
588 | if (!(cfg->io.flags & CISTPL_IO_16BIT)) | ||
589 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | ||
590 | p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK; | ||
591 | p_dev->io.BasePort1 = cfg->io.win[0].base; | ||
592 | p_dev->io.NumPorts1 = cfg->io.win[0].len; | ||
593 | return pcmcia_request_io(p_dev, &p_dev->io); | ||
594 | } | ||
595 | return -ENODEV; | ||
596 | } | ||
597 | |||
578 | static int mgslpc_config(struct pcmcia_device *link) | 598 | static int mgslpc_config(struct pcmcia_device *link) |
579 | { | 599 | { |
580 | MGSLPC_INFO *info = link->priv; | 600 | MGSLPC_INFO *info = link->priv; |
581 | tuple_t tuple; | 601 | int last_fn = RequestIO; |
582 | cisparse_t parse; | 602 | int last_ret; |
583 | int last_fn, last_ret; | ||
584 | u_char buf[64]; | ||
585 | cistpl_cftable_entry_t dflt = { 0 }; | ||
586 | cistpl_cftable_entry_t *cfg; | ||
587 | 603 | ||
588 | if (debug_level >= DEBUG_LEVEL_INFO) | 604 | if (debug_level >= DEBUG_LEVEL_INFO) |
589 | printk("mgslpc_config(0x%p)\n", link); | 605 | printk("mgslpc_config(0x%p)\n", link); |
590 | 606 | ||
591 | tuple.Attributes = 0; | 607 | last_ret = pcmcia_loop_config(link, mgslpc_ioprobe, NULL); |
592 | tuple.TupleData = buf; | 608 | if (last_ret != 0) |
593 | tuple.TupleDataMax = sizeof(buf); | ||
594 | tuple.TupleOffset = 0; | ||
595 | |||
596 | /* get CIS configuration entry */ | ||
597 | |||
598 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | ||
599 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
600 | |||
601 | cfg = &(parse.cftable_entry); | ||
602 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
603 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(&tuple, &parse)); | ||
604 | |||
605 | if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; | ||
606 | if (cfg->index == 0) | ||
607 | goto cs_failed; | 609 | goto cs_failed; |
608 | 610 | ||
609 | link->conf.ConfigIndex = cfg->index; | ||
610 | link->conf.Attributes |= CONF_ENABLE_IRQ; | ||
611 | |||
612 | /* IO window settings */ | ||
613 | link->io.NumPorts1 = 0; | ||
614 | if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { | ||
615 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io; | ||
616 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | ||
617 | if (!(io->flags & CISTPL_IO_8BIT)) | ||
618 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; | ||
619 | if (!(io->flags & CISTPL_IO_16BIT)) | ||
620 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | ||
621 | link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | ||
622 | link->io.BasePort1 = io->win[0].base; | ||
623 | link->io.NumPorts1 = io->win[0].len; | ||
624 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); | ||
625 | } | ||
626 | |||
627 | link->conf.Attributes = CONF_ENABLE_IRQ; | 611 | link->conf.Attributes = CONF_ENABLE_IRQ; |
628 | link->conf.IntType = INT_MEMORY_AND_IO; | 612 | link->conf.IntType = INT_MEMORY_AND_IO; |
629 | link->conf.ConfigIndex = 8; | 613 | link->conf.ConfigIndex = 8; |