[patch 15/21] pcmcia: find_mem_region only for non-statically mapped sockets

Dominik Brodowski linux at dominikbrodowski.de
Fri Dec 17 05:09:34 EST 2004


Calls to adjust_mem_region only happen if !SS_CAP_STATIC_MAP.

Signed-off-by: Dominik Brodowski <linux at brodo.de>
---

 drivers/pcmcia/rsrc_mgr.c |   12 +++++++++++-
 include/pcmcia/ss.h       |    3 +++
 2 files changed, 14 insertions(+), 1 deletion(-)

Index: 2.6.10-rc3/drivers/pcmcia/rsrc_mgr.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/rsrc_mgr.c	2004-12-05 10:26:07.485466240 +0100
+++ 2.6.10-rc3/drivers/pcmcia/rsrc_mgr.c	2004-12-05 10:26:07.648441464 +0100
@@ -638,7 +638,7 @@
 	return res;
 }
 
-struct resource *find_mem_region(u_long base, u_long num, u_long align,
+struct resource * nonstatic_find_mem_region(u_long base, u_long num, u_long align,
 				 int low, struct pcmcia_socket *s)
 {
 	struct resource *res = make_resource(0, num, IORESOURCE_MEM, s->dev.class_id);
@@ -1005,15 +1005,25 @@
 	return NULL;
 }
 
+struct resource *find_mem_region(u_long base, u_long num, u_long align,
+				 int low, struct pcmcia_socket *s)
+{
+	if (s->resource_ops->find_mem)
+		return s->resource_ops->find_mem(base, num, align, low, s);
+	return NULL;
+}
+
 
 struct pccard_resource_ops pccard_static_ops = {
 	.validate_mem = NULL,
 	.adjust_io_region = NULL,
 	.find_io = NULL,
+	.find_mem = NULL,
 };
 
 struct pccard_resource_ops pccard_nonstatic_ops = {
 	.validate_mem = pcmcia_nonstatic_validate_mem,
 	.adjust_io_region = nonstatic_adjust_io_region,
 	.find_io = nonstatic_find_io_region,
+	.find_mem = nonstatic_find_mem_region,
 };
Index: 2.6.10-rc3/include/pcmcia/ss.h
===================================================================
--- 2.6.10-rc3.orig/include/pcmcia/ss.h	2004-12-05 10:26:07.486466088 +0100
+++ 2.6.10-rc3/include/pcmcia/ss.h	2004-12-05 10:26:07.649441312 +0100
@@ -124,6 +124,9 @@
 	struct resource* (*find_io)	(unsigned long base, int num,
 					 unsigned long align,
 					 struct pcmcia_socket *s);
+	struct resource* (*find_mem)	(unsigned long base, unsigned long num,
+					 unsigned long align, int low,
+					 struct pcmcia_socket *s);
 };
 
 /*



More information about the linux-pcmcia mailing list