aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/rsrc_nonstatic.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-03-07 10:41:57 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2010-05-10 04:23:18 -0400
commit49b1153adfe18a3cce7e70aa26c690f275917cd0 (patch)
treed165a9bfaacd5be3da0bce12e6fe1126ce21118d /drivers/pcmcia/rsrc_nonstatic.c
parent5c128e84324ca9389bc5f7d39f6b18f6de4a58ec (diff)
pcmcia: move all pcmcia_resource_ops providers into one module
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/rsrc_nonstatic.c')
-rw-r--r--drivers/pcmcia/rsrc_nonstatic.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index a6eb7b59ba9f..c5ebc603b058 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -34,8 +34,10 @@
34#include <pcmcia/cistpl.h> 34#include <pcmcia/cistpl.h>
35#include "cs_internal.h" 35#include "cs_internal.h"
36 36
37/* moved to rsrc_mgr.c
37MODULE_AUTHOR("David A. Hinds, Dominik Brodowski"); 38MODULE_AUTHOR("David A. Hinds, Dominik Brodowski");
38MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
40*/
39 41
40/* Parameters that can be set with 'insmod' */ 42/* Parameters that can be set with 'insmod' */
41 43
@@ -70,27 +72,13 @@ struct socket_data {
70======================================================================*/ 72======================================================================*/
71 73
72static struct resource * 74static struct resource *
73make_resource(resource_size_t b, resource_size_t n, int flags, const char *name)
74{
75 struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
76
77 if (res) {
78 res->name = name;
79 res->start = b;
80 res->end = b + n - 1;
81 res->flags = flags;
82 }
83 return res;
84}
85
86static struct resource *
87claim_region(struct pcmcia_socket *s, resource_size_t base, 75claim_region(struct pcmcia_socket *s, resource_size_t base,
88 resource_size_t size, int type, char *name) 76 resource_size_t size, int type, char *name)
89{ 77{
90 struct resource *res, *parent; 78 struct resource *res, *parent;
91 79
92 parent = type & IORESOURCE_MEM ? &iomem_resource : &ioport_resource; 80 parent = type & IORESOURCE_MEM ? &iomem_resource : &ioport_resource;
93 res = make_resource(base, size, type | IORESOURCE_BUSY, name); 81 res = pcmcia_make_resource(base, size, type | IORESOURCE_BUSY, name);
94 82
95 if (res) { 83 if (res) {
96#ifdef CONFIG_PCI 84#ifdef CONFIG_PCI
@@ -698,7 +686,8 @@ static int nonstatic_adjust_io_region(struct resource *res, unsigned long r_star
698static struct resource *nonstatic_find_io_region(unsigned long base, int num, 686static struct resource *nonstatic_find_io_region(unsigned long base, int num,
699 unsigned long align, struct pcmcia_socket *s) 687 unsigned long align, struct pcmcia_socket *s)
700{ 688{
701 struct resource *res = make_resource(0, num, IORESOURCE_IO, dev_name(&s->dev)); 689 struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_IO,
690 dev_name(&s->dev));
702 struct socket_data *s_data = s->resource_data; 691 struct socket_data *s_data = s->resource_data;
703 struct pcmcia_align_data data; 692 struct pcmcia_align_data data;
704 unsigned long min = base; 693 unsigned long min = base;
@@ -730,7 +719,8 @@ static struct resource *nonstatic_find_io_region(unsigned long base, int num,
730static struct resource *nonstatic_find_mem_region(u_long base, u_long num, 719static struct resource *nonstatic_find_mem_region(u_long base, u_long num,
731 u_long align, int low, struct pcmcia_socket *s) 720 u_long align, int low, struct pcmcia_socket *s)
732{ 721{
733 struct resource *res = make_resource(0, num, IORESOURCE_MEM, dev_name(&s->dev)); 722 struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_MEM,
723 dev_name(&s->dev));
734 struct socket_data *s_data = s->resource_data; 724 struct socket_data *s_data = s->resource_data;
735 struct pcmcia_align_data data; 725 struct pcmcia_align_data data;
736 unsigned long min, max; 726 unsigned long min, max;