[patch 14/21] pcmcia: find_io_region only for non-statically mapped
sockets
Dominik Brodowski
linux at dominikbrodowski.de
Fri Dec 17 05:09:26 EST 2004
Calls to find_io_region only happen if !SS_CAP_STATIC_MAP.
Signed-off-by: Dominik Brodowski <linux at brodo.de>
---
drivers/pcmcia/rsrc_mgr.c | 43 +++++++++++++++++++++++++++----------------
include/pcmcia/ss.h | 3 +++
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.326490408 +0100
+++ 2.6.10-rc3/drivers/pcmcia/rsrc_mgr.c 2004-12-05 10:26:07.485466240 +0100
@@ -504,13 +504,6 @@
}
}
-void pcmcia_validate_mem(struct pcmcia_socket *s)
-{
- if (s->resource_ops->validate_mem)
- s->resource_ops->validate_mem(s);
-}
-EXPORT_SYMBOL(pcmcia_validate_mem);
-
struct pcmcia_align_data {
unsigned long mask;
unsigned long offset;
@@ -599,14 +592,6 @@
return ret;
}
-int adjust_io_region(struct resource *res, unsigned long r_start,
- unsigned long r_end, struct pcmcia_socket *s)
-{
- if (s->resource_ops->adjust_io_region)
- return s->resource_ops->adjust_io_region(res, r_start, r_end, s);
- return -ENOMEM;
-}
-
/*======================================================================
These find ranges of I/O ports or memory addresses that are not
@@ -620,7 +605,7 @@
======================================================================*/
-struct resource *find_io_region(unsigned long base, int num,
+struct resource *nonstatic_find_io_region(unsigned long base, int num,
unsigned long align, struct pcmcia_socket *s)
{
struct resource *res = make_resource(0, num, IORESOURCE_IO, s->dev.class_id);
@@ -997,12 +982,38 @@
}
+void pcmcia_validate_mem(struct pcmcia_socket *s)
+{
+ if (s->resource_ops->validate_mem)
+ s->resource_ops->validate_mem(s);
+}
+EXPORT_SYMBOL(pcmcia_validate_mem);
+
+int adjust_io_region(struct resource *res, unsigned long r_start,
+ unsigned long r_end, struct pcmcia_socket *s)
+{
+ if (s->resource_ops->adjust_io_region)
+ return s->resource_ops->adjust_io_region(res, r_start, r_end, s);
+ return -ENOMEM;
+}
+
+struct resource *find_io_region(unsigned long base, int num,
+ unsigned long align, struct pcmcia_socket *s)
+{
+ if (s->resource_ops->find_io)
+ return s->resource_ops->find_io(base, num, align, s);
+ return NULL;
+}
+
+
struct pccard_resource_ops pccard_static_ops = {
.validate_mem = NULL,
.adjust_io_region = NULL,
+ .find_io = 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,
};
Index: 2.6.10-rc3/include/pcmcia/ss.h
===================================================================
--- 2.6.10-rc3.orig/include/pcmcia/ss.h 2004-12-05 10:26:07.327490256 +0100
+++ 2.6.10-rc3/include/pcmcia/ss.h 2004-12-05 10:26:07.486466088 +0100
@@ -121,6 +121,9 @@
unsigned long r_start,
unsigned long r_end,
struct pcmcia_socket *s);
+ struct resource* (*find_io) (unsigned long base, int num,
+ unsigned long align,
+ struct pcmcia_socket *s);
};
/*
More information about the linux-pcmcia
mailing list