Commit aa4cb192 authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Linus Torvalds

[PATCH] pcmcia: adjust_io_region only for non-statically mapped sockets

Calls to adjust_io_region only happen if !SS_CAP_STATIC_MAP.
Signed-off-by: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 23d2f5db
......@@ -577,8 +577,8 @@ pcmcia_align(void *align_data, struct resource *res,
* 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 @@ int adjust_io_region(struct resource *res, unsigned long r_start,
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 @@ void release_resource_db(struct pcmcia_socket *s)
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,
};
......@@ -116,7 +116,11 @@ struct pccard_operations {
};
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);
};
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment