aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/nsp_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-24 11:23:51 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-08-03 03:04:11 -0400
commit90abdc3b973229bae98dd96649d9f7106cc177a4 (patch)
tree5c1a7a131b65560dd73b5103118d8c7631bd76a4 /drivers/scsi/pcmcia/nsp_cs.c
parent9a017a910346afd88ec2e065989903bf211a7d37 (diff)
pcmcia: do not use io_req_t when calling pcmcia_request_io()
Instead of io_req_t, drivers are now requested to fill out struct pcmcia_device *p_dev->resource[0,1] for up to two ioport ranges. After a call to pcmcia_request_io(), the ports found there are reserved, after calling pcmcia_request_configuration(), they may be used. 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: alsa-devel@alsa-project.org CC: linux-serial@vger.kernel.org CC: Michael Buesch <mb@bu3sch.de> Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/) Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/scsi/pcmcia/nsp_cs.c')
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index d929891809ab..8bb598bb440d 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1558,9 +1558,8 @@ static int nsp_cs_probe(struct pcmcia_device *link)
1558 nsp_dbg(NSP_DEBUG_INIT, "info=0x%p", info); 1558 nsp_dbg(NSP_DEBUG_INIT, "info=0x%p", info);
1559 1559
1560 /* The io structure describes IO port mapping */ 1560 /* The io structure describes IO port mapping */
1561 link->io.NumPorts1 = 0x10; 1561 link->resource[0]->end = 0x10;
1562 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 1562 link->resource[0]->flags = IO_DATA_PATH_WIDTH_AUTO;
1563 link->io.IOAddrLines = 10; /* not used */
1564 1563
1565 /* General socket configuration */ 1564 /* General socket configuration */
1566 link->conf.Attributes = CONF_ENABLE_IRQ; 1565 link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -1641,24 +1640,23 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
1641 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 1640 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
1642 1641
1643 /* IO window settings */ 1642 /* IO window settings */
1644 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 1643 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
1645 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 1644 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
1646 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 1645 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
1647 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 1646 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
1648 if (!(io->flags & CISTPL_IO_8BIT)) 1647 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
1649 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 1648 p_dev->resource[0]->flags |=
1650 if (!(io->flags & CISTPL_IO_16BIT)) 1649 pcmcia_io_cfg_data_width(io->flags);
1651 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1650 p_dev->resource[0]->start = io->win[0].base;
1652 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 1651 p_dev->resource[0]->end = io->win[0].len;
1653 p_dev->io.BasePort1 = io->win[0].base;
1654 p_dev->io.NumPorts1 = io->win[0].len;
1655 if (io->nwin > 1) { 1652 if (io->nwin > 1) {
1656 p_dev->io.Attributes2 = p_dev->io.Attributes1; 1653 p_dev->resource[1]->flags =
1657 p_dev->io.BasePort2 = io->win[1].base; 1654 p_dev->resource[0]->flags;
1658 p_dev->io.NumPorts2 = io->win[1].len; 1655 p_dev->resource[1]->start = io->win[1].base;
1656 p_dev->resource[1]->end = io->win[1].len;
1659 } 1657 }
1660 /* This reserves IO space but doesn't actually enable it */ 1658 /* This reserves IO space but doesn't actually enable it */
1661 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 1659 if (pcmcia_request_io(p_dev) != 0)
1662 goto next_entry; 1660 goto next_entry;
1663 } 1661 }
1664 1662