summaryrefslogtreecommitdiff
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-08-06 20:42:29 +0200
committerArnd Bergmann <arnd@arndb.de>2022-04-22 11:08:55 +0200
commitdf99e7bbbec3180693b3d932a9cbc88346e2a30e (patch)
treef352b866d3fc48a72e8e10255bc520ef1fc74962 /drivers/pcmcia
parentc8b8a93a0a3d3204c9d801d18fb98a5c04ff0b7c (diff)
ARM: omap1: use pci_remap_iospace() for omap_cf
The ISA I/O space handling in omap_cf is incompatible with PCI drivers in a multiplatform kernel, and requires a custom mach/io.h. Change the driver to use pci_remap_iospace() like PCI drivers do, so the generic ioport access can work across platforms. To actually use that code, we have to select CONFIG_PCI here. Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/omap_cf.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index 093022ce7d91..1972a8f6fa8e 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -205,6 +205,7 @@ static int __init omap_cf_probe(struct platform_device *pdev)
int irq;
int status;
struct resource *res;
+ struct resource iospace = DEFINE_RES_IO(SZ_64, SZ_4K);
seg = (int) pdev->dev.platform_data;
if (seg == 0 || seg > 3)
@@ -235,9 +236,9 @@ static int __init omap_cf_probe(struct platform_device *pdev)
cf->phys_cf = res->start;
/* pcmcia layer only remaps "real" memory */
- cf->socket.io_offset = (unsigned long)
- ioremap(cf->phys_cf + SZ_4K, SZ_2K);
- if (!cf->socket.io_offset) {
+ cf->socket.io_offset = iospace.start;
+ status = pci_remap_iospace(&iospace, cf->phys_cf + SZ_4K);
+ if (status) {
status = -ENOMEM;
goto fail1;
}
@@ -285,8 +286,6 @@ static int __init omap_cf_probe(struct platform_device *pdev)
fail2:
release_mem_region(cf->phys_cf, SZ_8K);
fail1:
- if (cf->socket.io_offset)
- iounmap((void __iomem *) cf->socket.io_offset);
free_irq(irq, cf);
fail0:
kfree(cf);
@@ -300,7 +299,6 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
cf->active = 0;
pcmcia_unregister_socket(&cf->socket);
del_timer_sync(&cf->timer);
- iounmap((void __iomem *) cf->socket.io_offset);
release_mem_region(cf->phys_cf, SZ_8K);
free_irq(cf->irq, cf);
kfree(cf);