aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpbios/rsparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp/pnpbios/rsparser.c')
-rw-r--r--drivers/pnp/pnpbios/rsparser.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c
index 8c83bc16a9be..ed63ecd9bf40 100644
--- a/drivers/pnp/pnpbios/rsparser.c
+++ b/drivers/pnp/pnpbios/rsparser.c
@@ -67,26 +67,15 @@ static void pnpbios_parse_allocated_ioresource(struct pnp_dev *dev,
67} 67}
68 68
69static void pnpbios_parse_allocated_memresource(struct pnp_dev *dev, 69static void pnpbios_parse_allocated_memresource(struct pnp_dev *dev,
70 int mem, int len) 70 int start, int len)
71{ 71{
72 struct resource *res; 72 int flags = 0;
73 int i; 73 int end = start + len - 1;
74 74
75 for (i = 0; i < PNP_MAX_MEM; i++) { 75 if (len <= 0)
76 res = pnp_get_resource(dev, IORESOURCE_MEM, i); 76 flags |= IORESOURCE_DISABLED;
77 if (!pnp_resource_valid(res))
78 break;
79 }
80 77
81 if (i < PNP_MAX_MEM) { 78 pnp_add_mem_resource(dev, start, end, flags);
82 res->flags = IORESOURCE_MEM; // Also clears _UNSET flag
83 if (len <= 0) {
84 res->flags |= IORESOURCE_DISABLED;
85 return;
86 }
87 res->start = (unsigned long)mem;
88 res->end = (unsigned long)(mem + len - 1);
89 }
90} 79}
91 80
92static unsigned char *pnpbios_parse_allocated_resource_data(struct pnp_dev *dev, 81static unsigned char *pnpbios_parse_allocated_resource_data(struct pnp_dev *dev,