From 385ee871092a524869c71a8180888aadcd6ca36d Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Wed, 6 Jan 2010 11:23:58 +0100 Subject: pcmcia: remove useless indirection As release_resoure_db() used to be called only from one place, and it's a two-line function, remove it. Tested-by: Wolfram Sang Signed-off-by: Dominik Brodowski --- drivers/pcmcia/rsrc_mgr.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'drivers/pcmcia/rsrc_mgr.c') diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c index 52db17263d8b..66c780073cd2 100644 --- a/drivers/pcmcia/rsrc_mgr.c +++ b/drivers/pcmcia/rsrc_mgr.c @@ -58,12 +58,6 @@ struct resource *pcmcia_find_mem_region(u_long base, u_long num, u_long align, } EXPORT_SYMBOL(pcmcia_find_mem_region); -void release_resource_db(struct pcmcia_socket *s) -{ - if (s->resource_ops->exit) - s->resource_ops->exit(s); -} - static int static_init(struct pcmcia_socket *s) { -- cgit v1.2.3 From f9c316f4a2d32e4d03497ecb24e1d2309361a5b8 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Wed, 6 Jan 2010 11:32:22 +0100 Subject: pcmcia: remove some rsrc_mgr indirections Remove rsrc_mgr indirections only used by pcmcia_resource.c Tested-by: Wolfram Sang Signed-off-by: Dominik Brodowski --- drivers/pcmcia/rsrc_mgr.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'drivers/pcmcia/rsrc_mgr.c') diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c index 66c780073cd2..81540c420bbd 100644 --- a/drivers/pcmcia/rsrc_mgr.c +++ b/drivers/pcmcia/rsrc_mgr.c @@ -31,24 +31,6 @@ int pcmcia_validate_mem(struct pcmcia_socket *s) } EXPORT_SYMBOL(pcmcia_validate_mem); -int pcmcia_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; -} -EXPORT_SYMBOL(pcmcia_adjust_io_region); - -struct resource *pcmcia_find_io_region(unsigned long base, int num, - unsigned long align, struct pcmcia_socket *s) -{ - if (s->resource_ops->find_io) - return s->resource_ops->find_io(base, num, align, s); - return NULL; -} -EXPORT_SYMBOL(pcmcia_find_io_region); - struct resource *pcmcia_find_mem_region(u_long base, u_long num, u_long align, int low, struct pcmcia_socket *s) { -- cgit v1.2.3 From a3ac9af56c14c366a76fb4916995e57392c7b7d5 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Wed, 6 Jan 2010 14:03:03 +0100 Subject: pcmcia: remove remaining rsrc_mgr indirections Move rsrc_mgr indirections only used by the pcmcia module to the pcmcia module. Tested-by: Wolfram Sang Signed-off-by: Dominik Brodowski --- drivers/pcmcia/rsrc_mgr.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'drivers/pcmcia/rsrc_mgr.c') diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c index 81540c420bbd..cdd30c180066 100644 --- a/drivers/pcmcia/rsrc_mgr.c +++ b/drivers/pcmcia/rsrc_mgr.c @@ -21,26 +21,6 @@ #include #include "cs_internal.h" - -int pcmcia_validate_mem(struct pcmcia_socket *s) -{ - if (s->resource_ops->validate_mem) - return s->resource_ops->validate_mem(s); - /* if there is no callback, we can assume that everything is OK */ - return 0; -} -EXPORT_SYMBOL(pcmcia_validate_mem); - -struct resource *pcmcia_find_mem_region(u_long base, u_long num, u_long align, - int low, struct pcmcia_socket *s) -{ - if (s->resource_ops->find_mem) - return s->resource_ops->find_mem(base, num, align, low, s); - return NULL; -} -EXPORT_SYMBOL(pcmcia_find_mem_region); - - static int static_init(struct pcmcia_socket *s) { unsigned long flags; -- cgit v1.2.3 From 00ce99ff506a17882747a7d6874e3f5206a99043 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 16 Jan 2010 09:14:11 +0100 Subject: pcmcia: simplify locking replace pcmcia_socket->lock and pcmcia_dev_list_lock by using the per-socket "ops_mutex", as we do neither need different locks nor a spinlock here. Tested-by: Wolfram Sang Signed-off-by: Dominik Brodowski --- drivers/pcmcia/rsrc_mgr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/pcmcia/rsrc_mgr.c') diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c index cdd30c180066..b81586622d02 100644 --- a/drivers/pcmcia/rsrc_mgr.c +++ b/drivers/pcmcia/rsrc_mgr.c @@ -23,14 +23,12 @@ static int static_init(struct pcmcia_socket *s) { - unsigned long flags; - /* the good thing about SS_CAP_STATIC_MAP sockets is * that they don't need a resource database */ - spin_lock_irqsave(&s->lock, flags); + mutex_lock(&s->ops_mutex); s->resource_setup_done = 1; - spin_unlock_irqrestore(&s->lock, flags); + mutex_unlock(&s->ops_mutex); return 0; } -- cgit v1.2.3 From cfe5d809518eda3d5e2da87c5ccbe8647143573a Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 17 Jan 2010 19:31:45 +0100 Subject: pcmcia: use ops_mutex for rsrc_{mgr,nonstatic} locking Tested-by: Wolfram Sang Signed-off-by: Dominik Brodowski --- drivers/pcmcia/rsrc_mgr.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/pcmcia/rsrc_mgr.c') diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c index b81586622d02..aca2cfd02ca5 100644 --- a/drivers/pcmcia/rsrc_mgr.c +++ b/drivers/pcmcia/rsrc_mgr.c @@ -26,9 +26,7 @@ static int static_init(struct pcmcia_socket *s) /* the good thing about SS_CAP_STATIC_MAP sockets is * that they don't need a resource database */ - mutex_lock(&s->ops_mutex); s->resource_setup_done = 1; - mutex_unlock(&s->ops_mutex); return 0; } -- cgit v1.2.3