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 7f8d65728599..8c83bc16a9be 100644
--- a/drivers/pnp/pnpbios/rsparser.c
+++ b/drivers/pnp/pnpbios/rsparser.c
@@ -55,26 +55,15 @@ inline void pcibios_penalize_isa_irq(int irq, int active)
55 */ 55 */
56 56
57static void pnpbios_parse_allocated_ioresource(struct pnp_dev *dev, 57static void pnpbios_parse_allocated_ioresource(struct pnp_dev *dev,
58 int io, int len) 58 int start, int len)
59{ 59{
60 struct resource *res; 60 int flags = 0;
61 int i; 61 int end = start + len - 1;
62 62
63 for (i = 0; i < PNP_MAX_PORT; i++) { 63 if (len <= 0 || end >= 0x10003)
64 res = pnp_get_resource(dev, IORESOURCE_IO, i); 64 flags |= IORESOURCE_DISABLED;
65 if (!pnp_resource_valid(res))
66 break;
67 }
68 65
69 if (i < PNP_MAX_PORT) { 66 pnp_add_io_resource(dev, start, end, flags);
70 res->flags = IORESOURCE_IO; // Also clears _UNSET flag
71 if (len <= 0 || (io + len - 1) >= 0x10003) {
72 res->flags |= IORESOURCE_DISABLED;
73 return;
74 }
75 res->start = (unsigned long)io;
76 res->end = (unsigned long)(io + len - 1);
77 }
78} 67}
79 68
80static void pnpbios_parse_allocated_memresource(struct pnp_dev *dev, 69static void pnpbios_parse_allocated_memresource(struct pnp_dev *dev,