diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-07-28 04:59:06 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-09-29 11:20:21 -0400 |
commit | cdb138080b78146d1cdadba9f5dadbeb97445b91 (patch) | |
tree | fae26f709ed0f19648db79059234faf9fa028051 /drivers/net/pcmcia/smc91c92_cs.c | |
parent | 899611ee7d373e5eeda08e9a8632684e1ebbbf00 (diff) |
pcmcia: do not use win_req_t when calling pcmcia_request_window()
Instead of win_req_t, drivers are now requested to fill out
struct pcmcia_device *p_dev->resource[2,3,4,5] for up to four iomem
ranges. After a call to pcmcia_request_window(), the windows found there
are reserved and may be used until pcmcia_release_window() is called.
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-mtd@lists.infradead.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/net/pcmcia/smc91c92_cs.c')
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 377367d03b41..acc680739c89 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -442,7 +442,6 @@ static int mhz_mfc_config(struct pcmcia_device *link) | |||
442 | { | 442 | { |
443 | struct net_device *dev = link->priv; | 443 | struct net_device *dev = link->priv; |
444 | struct smc_private *smc = netdev_priv(dev); | 444 | struct smc_private *smc = netdev_priv(dev); |
445 | win_req_t req; | ||
446 | unsigned int offset; | 445 | unsigned int offset; |
447 | int i; | 446 | int i; |
448 | 447 | ||
@@ -459,16 +458,16 @@ static int mhz_mfc_config(struct pcmcia_device *link) | |||
459 | dev->base_addr = link->resource[0]->start; | 458 | dev->base_addr = link->resource[0]->start; |
460 | 459 | ||
461 | /* Allocate a memory window, for accessing the ISR */ | 460 | /* Allocate a memory window, for accessing the ISR */ |
462 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; | 461 | link->resource[2]->flags = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; |
463 | req.Base = req.Size = 0; | 462 | link->resource[2]->start = link->resource[2]->end = 0; |
464 | req.AccessSpeed = 0; | 463 | i = pcmcia_request_window(link, link->resource[2], 0); |
465 | i = pcmcia_request_window(link, &req, &link->win); | ||
466 | if (i != 0) | 464 | if (i != 0) |
467 | return -ENODEV; | 465 | return -ENODEV; |
468 | 466 | ||
469 | smc->base = ioremap(req.Base, req.Size); | 467 | smc->base = ioremap(link->resource[2]->start, |
468 | resource_size(link->resource[2])); | ||
470 | offset = (smc->manfid == MANFID_MOTOROLA) ? link->conf.ConfigBase : 0; | 469 | offset = (smc->manfid == MANFID_MOTOROLA) ? link->conf.ConfigBase : 0; |
471 | i = pcmcia_map_mem_page(link, link->win, offset); | 470 | i = pcmcia_map_mem_page(link, link->resource[2], offset); |
472 | if ((i == 0) && | 471 | if ((i == 0) && |
473 | (smc->manfid == MANFID_MEGAHERTZ) && | 472 | (smc->manfid == MANFID_MEGAHERTZ) && |
474 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) | 473 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) |
@@ -999,7 +998,7 @@ config_failed: | |||
999 | static void smc91c92_release(struct pcmcia_device *link) | 998 | static void smc91c92_release(struct pcmcia_device *link) |
1000 | { | 999 | { |
1001 | dev_dbg(&link->dev, "smc91c92_release\n"); | 1000 | dev_dbg(&link->dev, "smc91c92_release\n"); |
1002 | if (link->win) { | 1001 | if (link->resource[2]->end) { |
1003 | struct net_device *dev = link->priv; | 1002 | struct net_device *dev = link->priv; |
1004 | struct smc_private *smc = netdev_priv(dev); | 1003 | struct smc_private *smc = netdev_priv(dev); |
1005 | iounmap(smc->base); | 1004 | iounmap(smc->base); |