aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/rsrc_nonstatic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/rsrc_nonstatic.c')
-rw-r--r--drivers/pcmcia/rsrc_nonstatic.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index dcd1a4ad3d63..96f348b35fde 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -28,7 +28,6 @@
28 28
29#include <asm/irq.h> 29#include <asm/irq.h>
30 30
31#include <pcmcia/cs_types.h>
32#include <pcmcia/ss.h> 31#include <pcmcia/ss.h>
33#include <pcmcia/cs.h> 32#include <pcmcia/cs.h>
34#include <pcmcia/cistpl.h> 33#include <pcmcia/cistpl.h>
@@ -64,6 +63,9 @@ struct socket_data {
64#define MEM_PROBE_LOW (1 << 0) 63#define MEM_PROBE_LOW (1 << 0)
65#define MEM_PROBE_HIGH (1 << 1) 64#define MEM_PROBE_HIGH (1 << 1)
66 65
66/* Action field */
67#define REMOVE_MANAGED_RESOURCE 1
68#define ADD_MANAGED_RESOURCE 2
67 69
68/*====================================================================== 70/*======================================================================
69 71
@@ -716,7 +718,7 @@ static struct resource *__nonstatic_find_io_region(struct pcmcia_socket *s,
716 718
717static int nonstatic_find_io(struct pcmcia_socket *s, unsigned int attr, 719static int nonstatic_find_io(struct pcmcia_socket *s, unsigned int attr,
718 unsigned int *base, unsigned int num, 720 unsigned int *base, unsigned int num,
719 unsigned int align) 721 unsigned int align, struct resource **parent)
720{ 722{
721 int i, ret = 0; 723 int i, ret = 0;
722 724
@@ -758,6 +760,7 @@ static int nonstatic_find_io(struct pcmcia_socket *s, unsigned int attr,
758 ((res->flags & ~IORESOURCE_BITS) | 760 ((res->flags & ~IORESOURCE_BITS) |
759 (attr & IORESOURCE_BITS)); 761 (attr & IORESOURCE_BITS));
760 s->io[i].InUse = num; 762 s->io[i].InUse = num;
763 *parent = res;
761 return 0; 764 return 0;
762 } 765 }
763 766
@@ -773,6 +776,7 @@ static int nonstatic_find_io(struct pcmcia_socket *s, unsigned int attr,
773 continue; 776 continue;
774 *base = try; 777 *base = try;
775 s->io[i].InUse += num; 778 s->io[i].InUse += num;
779 *parent = res;
776 return 0; 780 return 0;
777 } 781 }
778 } 782 }
@@ -791,6 +795,7 @@ static int nonstatic_find_io(struct pcmcia_socket *s, unsigned int attr,
791 continue; 795 continue;
792 *base = try; 796 *base = try;
793 s->io[i].InUse += num; 797 s->io[i].InUse += num;
798 *parent = res;
794 return 0; 799 return 0;
795 } 800 }
796 } 801 }
@@ -1055,8 +1060,6 @@ struct pccard_resource_ops pccard_nonstatic_ops = {
1055 .validate_mem = pcmcia_nonstatic_validate_mem, 1060 .validate_mem = pcmcia_nonstatic_validate_mem,
1056 .find_io = nonstatic_find_io, 1061 .find_io = nonstatic_find_io,
1057 .find_mem = nonstatic_find_mem_region, 1062 .find_mem = nonstatic_find_mem_region,
1058 .add_io = adjust_io,
1059 .add_mem = adjust_memory,
1060 .init = nonstatic_init, 1063 .init = nonstatic_init,
1061 .exit = nonstatic_release_resource_db, 1064 .exit = nonstatic_release_resource_db,
1062}; 1065};
@@ -1115,8 +1118,6 @@ static ssize_t store_io_db(struct device *dev,
1115 1118
1116 mutex_lock(&s->ops_mutex); 1119 mutex_lock(&s->ops_mutex);
1117 ret = adjust_io(s, add, start_addr, end_addr); 1120 ret = adjust_io(s, add, start_addr, end_addr);
1118 if (!ret)
1119 s->resource_setup_new = 1;
1120 mutex_unlock(&s->ops_mutex); 1121 mutex_unlock(&s->ops_mutex);
1121 1122
1122 return ret ? ret : count; 1123 return ret ? ret : count;
@@ -1183,8 +1184,6 @@ static ssize_t store_mem_db(struct device *dev,
1183 1184
1184 mutex_lock(&s->ops_mutex); 1185 mutex_lock(&s->ops_mutex);
1185 ret = adjust_memory(s, add, start_addr, end_addr); 1186 ret = adjust_memory(s, add, start_addr, end_addr);
1186 if (!ret)
1187 s->resource_setup_new = 1;
1188 mutex_unlock(&s->ops_mutex); 1187 mutex_unlock(&s->ops_mutex);
1189 1188
1190 return ret ? ret : count; 1189 return ret ? ret : count;