summaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/rsrc_mgr.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-03-20 13:10:47 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2010-05-10 10:23:19 +0200
commitb19a7275dec4b470ea9abaae6129d21a0d75ab2f (patch)
tree9a3824270dee0494a198f969ae5b8c53e4950165 /drivers/pcmcia/rsrc_mgr.c
parentpcmcia: move all pcmcia_resource_ops providers into one module (diff)
downloadlinux-b19a7275dec4b470ea9abaae6129d21a0d75ab2f.tar.xz
linux-b19a7275dec4b470ea9abaae6129d21a0d75ab2f.zip
pcmcia: clarify alloc_io_space, move it to resource handlers
Clean up the alloc_io_space() function by moving most of it to the actual resource_ops. This allows for a bit less re-directions. Future cleanups will follow, and will make up for the code duplication currently present between rsrc_iodyn and rsrc_nonstatic (which are hardly ever built at the same time anyway, therefore no increase in built size). Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/rsrc_mgr.c')
-rw-r--r--drivers/pcmcia/rsrc_mgr.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
index 71838cae890c..142efac3c387 100644
--- a/drivers/pcmcia/rsrc_mgr.c
+++ b/drivers/pcmcia/rsrc_mgr.c
@@ -46,11 +46,21 @@ struct resource *pcmcia_make_resource(unsigned long start, unsigned long end,
return res;
}
+static int static_find_io(struct pcmcia_socket *s, unsigned int attr,
+ unsigned int *base, unsigned int num,
+ unsigned int align)
+{
+ if (!s->io_offset)
+ return -EINVAL;
+ *base = s->io_offset | (*base & 0x0fff);
+
+ return 0;
+}
+
struct pccard_resource_ops pccard_static_ops = {
.validate_mem = NULL,
- .adjust_io_region = NULL,
- .find_io = NULL,
+ .find_io = static_find_io,
.find_mem = NULL,
.add_io = NULL,
.add_mem = NULL,