From: Dominik Brodowski Calls to adjust_io_region only happen if !SS_CAP_STATIC_MAP. Signed-off-by: Dominik Brodowski Signed-off-by: Andrew Morton --- 25-akpm/drivers/pcmcia/rsrc_mgr.c | 14 ++++++++++++-- 25-akpm/include/pcmcia/ss.h | 6 +++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff -puN drivers/pcmcia/rsrc_mgr.c~pcmcia-adjust_io_region-only-for-non-statically-mapped-sockets drivers/pcmcia/rsrc_mgr.c --- 25/drivers/pcmcia/rsrc_mgr.c~pcmcia-adjust_io_region-only-for-non-statically-mapped-sockets Fri Dec 17 15:25:07 2004 +++ 25-akpm/drivers/pcmcia/rsrc_mgr.c Fri Dec 17 15:25:07 2004 @@ -577,8 +577,8 @@ pcmcia_align(void *align_data, struct re * 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 *re 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_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, }; diff -puN include/pcmcia/ss.h~pcmcia-adjust_io_region-only-for-non-statically-mapped-sockets include/pcmcia/ss.h --- 25/include/pcmcia/ss.h~pcmcia-adjust_io_region-only-for-non-statically-mapped-sockets Fri Dec 17 15:25:07 2004 +++ 25-akpm/include/pcmcia/ss.h Fri Dec 17 15:25:07 2004 @@ -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); }; /* _