[patch 13/21] pcmcia: adjust_io_region only for non-statically
mapped sockets
Dominik Brodowski
linux at dominikbrodowski.de
Fri Dec 17 05:09:15 EST 2004
Calls to adjust_io_region only happen if !SS_CAP_STATIC_MAP.
Signed-off-by: Dominik Brodowski <linux at brodo.de>
---
drivers/pcmcia/rsrc_mgr.c | 14 ++++++++++++--
include/pcmcia/ss.h | 6 +++++-
2 files changed, 17 insertions(+), 3 deletions(-)
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.122521416 +0100
+++ 2.6.10-rc3/drivers/pcmcia/rsrc_mgr.c 2004-12-05 10:26:07.326490408 +0100
@@ -577,8 +577,8 @@
* Adjust an existing IO region allocation, but making sure that we don't
* encroach outside the resources which the user supplied.
*/
-int adjust_io_region(struct resource *res, unsigned long r_start,
- unsigned long r_end, struct pcmcia_socket *s)
+static int nonstatic_adjust_io_region(struct resource *res, unsigned long r_start,
+ unsigned long r_end, struct pcmcia_socket *s)
{
resource_map_t *m;
int ret = -ENOMEM;
@@ -599,6 +599,14 @@
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
@@ -991,8 +999,10 @@
struct pccard_resource_ops pccard_static_ops = {
.validate_mem = NULL,
+ .adjust_io_region = NULL,
};
struct pccard_resource_ops pccard_nonstatic_ops = {
.validate_mem = pcmcia_nonstatic_validate_mem,
+ .adjust_io_region = nonstatic_adjust_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.123521264 +0100
+++ 2.6.10-rc3/include/pcmcia/ss.h 2004-12-05 10:26:07.327490256 +0100
@@ -116,7 +116,11 @@
};
struct pccard_resource_ops {
- void (*validate_mem) (struct pcmcia_socket *s);
+ void (*validate_mem) (struct pcmcia_socket *s);
+ int (*adjust_io_region) (struct resource *res,
+ unsigned long r_start,
+ unsigned long r_end,
+ struct pcmcia_socket *s);
};
/*
More information about the linux-pcmcia
mailing list