diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-03-20 08:10:47 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-05-10 04:23:19 -0400 |
commit | b19a7275dec4b470ea9abaae6129d21a0d75ab2f (patch) | |
tree | 9a3824270dee0494a198f969ae5b8c53e4950165 /drivers/pcmcia/rsrc_mgr.c | |
parent | 49b1153adfe18a3cce7e70aa26c690f275917cd0 (diff) |
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.c | 14 |
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, | |||
46 | return res; | 46 | return res; |
47 | } | 47 | } |
48 | 48 | ||
49 | static int static_find_io(struct pcmcia_socket *s, unsigned int attr, | ||
50 | unsigned int *base, unsigned int num, | ||
51 | unsigned int align) | ||
52 | { | ||
53 | if (!s->io_offset) | ||
54 | return -EINVAL; | ||
55 | *base = s->io_offset | (*base & 0x0fff); | ||
56 | |||
57 | return 0; | ||
58 | } | ||
59 | |||
49 | 60 | ||
50 | struct pccard_resource_ops pccard_static_ops = { | 61 | struct pccard_resource_ops pccard_static_ops = { |
51 | .validate_mem = NULL, | 62 | .validate_mem = NULL, |
52 | .adjust_io_region = NULL, | 63 | .find_io = static_find_io, |
53 | .find_io = NULL, | ||
54 | .find_mem = NULL, | 64 | .find_mem = NULL, |
55 | .add_io = NULL, | 65 | .add_io = NULL, |
56 | .add_mem = NULL, | 66 | .add_mem = NULL, |