[PATCH 44/49] pcmcia: encapsulate ioaddr_t

Dominik Brodowski linux at dominikbrodowski.net
Mon Oct 13 13:48:29 EDT 2008


By now, ioaddr_t should only be used by the deprecated ioctl, as it does not
correctly reflect the maximum ioport range at least on some architectures.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/au1000_generic.c |    2 +-
 drivers/pcmcia/au1000_generic.h |    2 +-
 drivers/usb/host/sl811_cs.c     |    3 ++-
 include/pcmcia/cs_types.h       |    8 --------
 include/pcmcia/ds.h             |    8 ++++++++
 5 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 75e8f85..fc1de46 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -292,7 +292,7 @@ au1x00_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *map)
 		skt->spd_io[map->map] = speed;
 	}
 
-	map->start=(ioaddr_t)(u32)skt->virt_io;
+	map->start=(unsigned int)(u32)skt->virt_io;
 	map->stop=map->start+MAP_SIZE;
 	return 0;
 
diff --git a/drivers/pcmcia/au1000_generic.h b/drivers/pcmcia/au1000_generic.h
index a53ef59..13a4fbc 100644
--- a/drivers/pcmcia/au1000_generic.h
+++ b/drivers/pcmcia/au1000_generic.h
@@ -116,7 +116,7 @@ struct au1000_pcmcia_socket {
 	struct resource		res_attr;
 
 	void *                 	virt_io;
-	ioaddr_t              	phys_io;
+	unsigned int		phys_io;
 	unsigned int           	phys_attr;
 	unsigned int           	phys_mem;
 	unsigned short        	speed_io, speed_attr, speed_mem;
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c
index ca733b7..516848d 100644
--- a/drivers/usb/host/sl811_cs.c
+++ b/drivers/usb/host/sl811_cs.c
@@ -112,7 +112,8 @@ static struct platform_device platform_dev = {
 	.num_resources		= ARRAY_SIZE(resources),
 };
 
-static int sl811_hc_init(struct device *parent, ioaddr_t base_addr, int irq)
+static int sl811_hc_init(struct device *parent, resource_size_t base_addr,
+			 int irq)
 {
 	if (platform_dev.dev.parent)
 		return -EBUSY;
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h
index f402a0f..315965a 100644
--- a/include/pcmcia/cs_types.h
+++ b/include/pcmcia/cs_types.h
@@ -21,14 +21,6 @@
 #include <sys/types.h>
 #endif
 
-#if defined(__arm__) || defined(__mips__) || defined(__avr32__) || \
-	defined(__bfin__)
-/* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */
-typedef u_int   ioaddr_t;
-#else
-typedef u_short	ioaddr_t;
-#endif
-
 typedef u_short	socket_t;
 typedef u_int	event_t;
 typedef u_char	cisdata_t;
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index bdf7d5e..279df0f 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -171,6 +171,14 @@ const char *pcmcia_error_ret(int ret);
 
 #if defined(CONFIG_PCMCIA_IOCTL) || !defined(__KERNEL__)
 
+#if defined(__arm__) || defined(__mips__) || defined(__avr32__) || \
+	defined(__bfin__)
+/* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */
+typedef u_int   ioaddr_t;
+#else
+typedef u_short	ioaddr_t;
+#endif
+
 /* for AdjustResourceInfo */
 typedef struct adjust_t {
 	u_int			Action;
-- 
1.5.4.3




More information about the linux-pcmcia mailing list