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.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index e9e66ed4fa31..ead151242a64 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -320,6 +320,7 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
320 const char *ubuf, size_t count) 320 const char *ubuf, size_t count)
321{ 321{
322 struct pnp_dev *dev = to_pnp_dev(dmdev); 322 struct pnp_dev *dev = to_pnp_dev(dmdev);
323 struct pnp_resource *pnp_res;
323 struct resource *res; 324 struct resource *res;
324 char *buf = (void *)ubuf; 325 char *buf = (void *)ubuf;
325 int retval = 0; 326 int retval = 0;
@@ -380,10 +381,12 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
380 buf += 2; 381 buf += 2;
381 while (isspace(*buf)) 382 while (isspace(*buf))
382 ++buf; 383 ++buf;
383 res = pnp_get_resource(dev, IORESOURCE_IO, 384 pnp_res = pnp_get_pnp_resource(dev,
384 nport); 385 IORESOURCE_IO, nport);
385 if (!res) 386 if (!pnp_res)
386 break; 387 break;
388 pnp_res->index = nport;
389 res = &pnp_res->res;
387 res->start = simple_strtoul(buf, &buf, 0); 390 res->start = simple_strtoul(buf, &buf, 0);
388 while (isspace(*buf)) 391 while (isspace(*buf))
389 ++buf; 392 ++buf;
@@ -402,10 +405,12 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
402 buf += 3; 405 buf += 3;
403 while (isspace(*buf)) 406 while (isspace(*buf))
404 ++buf; 407 ++buf;
405 res = pnp_get_resource(dev, IORESOURCE_MEM, 408 pnp_res = pnp_get_pnp_resource(dev,
406 nmem); 409 IORESOURCE_MEM, nmem);
407 if (!res) 410 if (!pnp_res)
408 break; 411 break;
412 pnp_res->index = nmem;
413 res = &pnp_res->res;
409 res->start = simple_strtoul(buf, &buf, 0); 414 res->start = simple_strtoul(buf, &buf, 0);
410 while (isspace(*buf)) 415 while (isspace(*buf))
411 ++buf; 416 ++buf;
@@ -424,10 +429,12 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
424 buf += 3; 429 buf += 3;
425 while (isspace(*buf)) 430 while (isspace(*buf))
426 ++buf; 431 ++buf;
427 res = pnp_get_resource(dev, IORESOURCE_IRQ, 432 pnp_res = pnp_get_pnp_resource(dev,
428 nirq); 433 IORESOURCE_IRQ, nirq);
429 if (!res) 434 if (!pnp_res)
430 break; 435 break;
436 pnp_res->index = nirq;
437 res = &pnp_res->res;
431 res->start = res->end = 438 res->start = res->end =
432 simple_strtoul(buf, &buf, 0); 439 simple_strtoul(buf, &buf, 0);
433 res->flags = IORESOURCE_IRQ; 440 res->flags = IORESOURCE_IRQ;
@@ -438,10 +445,12 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
438 buf += 3; 445 buf += 3;
439 while (isspace(*buf)) 446 while (isspace(*buf))
440 ++buf; 447 ++buf;
441 res = pnp_get_resource(dev, IORESOURCE_DMA, 448 pnp_res = pnp_get_pnp_resource(dev,
442 ndma); 449 IORESOURCE_DMA, ndma);
443 if (!res) 450 if (!pnp_res)
444 break; 451 break;
452 pnp_res->index = ndma;
453 res = &pnp_res->res;
445 res->start = res->end = 454 res->start = res->end =
446 simple_strtoul(buf, &buf, 0); 455 simple_strtoul(buf, &buf, 0);
447 res->flags = IORESOURCE_DMA; 456 res->flags = IORESOURCE_DMA;