aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia/synclink_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-30 07:13:46 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-09-29 11:20:24 -0400
commit00990e7ce0b0e596fe41d9c64d6933ea70084003 (patch)
tree189e0dd92860feba84231c66955749574cac5d6d /drivers/char/pcmcia/synclink_cs.c
parent440eed43e2a95bb842488755683716814da10f2b (diff)
pcmcia: use autoconfiguration feature for ioports and iomem
When CONF_AUTO_SET_IO or CONF_AUTO_SET_IOMEM are set, the corresponding fields in struct pcmcia_device *p_dev->resource[0,1,2] are set accordinly. Drivers wishing to override certain settings may do so in the callback function, but they no longer need to parse the CIS entries stored in cistpl_cftable_entry_t themselves. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-ide@vger.kernel.org CC: linux-usb@vger.kernel.org CC: laforge@gnumonks.org CC: linux-mtd@lists.infradead.org CC: linux-bluetooth@vger.kernel.org CC: alsa-devel@alsa-project.org CC: linux-serial@vger.kernel.org CC: Jiri Kosina <jkosina@suse.cz> CC: linux-scsi@vger.kernel.org Tested-by: Wolfram Sang <w.sang@pengutronix.de> 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.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index c701434f76b7..a343b8f817e4 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -561,19 +561,8 @@ static int mgslpc_probe(struct pcmcia_device *link)
561/* Card has been inserted. 561/* Card has been inserted.
562 */ 562 */
563 563
564static int mgslpc_ioprobe(struct pcmcia_device *p_dev, 564static int mgslpc_ioprobe(struct pcmcia_device *p_dev, void *priv_data)
565 cistpl_cftable_entry_t *cfg,
566 cistpl_cftable_entry_t *dflt,
567 void *priv_data)
568{ 565{
569 if (!cfg->io.nwin)
570 return -ENODEV;
571
572 p_dev->resource[0]->start = cfg->io.win[0].base;
573 p_dev->resource[0]->end = cfg->io.win[0].len;
574 p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags);
575 p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
576
577 return pcmcia_request_io(p_dev); 566 return pcmcia_request_io(p_dev);
578} 567}
579 568
@@ -585,11 +574,12 @@ static int mgslpc_config(struct pcmcia_device *link)
585 if (debug_level >= DEBUG_LEVEL_INFO) 574 if (debug_level >= DEBUG_LEVEL_INFO)
586 printk("mgslpc_config(0x%p)\n", link); 575 printk("mgslpc_config(0x%p)\n", link);
587 576
577 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
578
588 ret = pcmcia_loop_config(link, mgslpc_ioprobe, NULL); 579 ret = pcmcia_loop_config(link, mgslpc_ioprobe, NULL);
589 if (ret != 0) 580 if (ret != 0)
590 goto failed; 581 goto failed;
591 582
592 link->config_flags |= CONF_ENABLE_IRQ;
593 link->config_index = 8; 583 link->config_index = 8;
594 link->config_regs = PRESENT_OPTION; 584 link->config_regs = PRESENT_OPTION;
595 585