aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp/interface.c')
-rw-r--r--drivers/pnp/interface.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index 00c8a970a97e..77d8bf01b485 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -324,7 +324,7 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
324 struct resource *res; 324 struct resource *res;
325 char *buf = (void *)ubuf; 325 char *buf = (void *)ubuf;
326 int retval = 0; 326 int retval = 0;
327 resource_size_t start; 327 resource_size_t start, end;
328 328
329 if (dev->status & PNP_ATTACHED) { 329 if (dev->status & PNP_ATTACHED) {
330 retval = -EBUSY; 330 retval = -EBUSY;
@@ -382,24 +382,20 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
382 buf += 2; 382 buf += 2;
383 while (isspace(*buf)) 383 while (isspace(*buf))
384 ++buf; 384 ++buf;
385 pnp_res = pnp_get_pnp_resource(dev, 385 start = simple_strtoul(buf, &buf, 0);
386 IORESOURCE_IO, nport);
387 if (!pnp_res)
388 break;
389 pnp_res->index = nport;
390 res = &pnp_res->res;
391 res->start = simple_strtoul(buf, &buf, 0);
392 while (isspace(*buf)) 386 while (isspace(*buf))
393 ++buf; 387 ++buf;
394 if (*buf == '-') { 388 if (*buf == '-') {
395 buf += 1; 389 buf += 1;
396 while (isspace(*buf)) 390 while (isspace(*buf))
397 ++buf; 391 ++buf;
398 res->end = simple_strtoul(buf, &buf, 0); 392 end = simple_strtoul(buf, &buf, 0);
399 } else 393 } else
400 res->end = res->start; 394 end = start;
401 res->flags = IORESOURCE_IO; 395 pnp_res = pnp_add_io_resource(dev, start, end,
402 nport++; 396 0);
397 if (pnp_res)
398 pnp_res->index = nport++;
403 continue; 399 continue;
404 } 400 }
405 if (!strnicmp(buf, "mem", 3)) { 401 if (!strnicmp(buf, "mem", 3)) {