diff options
Diffstat (limited to 'drivers/pnp/interface.c')
-rw-r--r-- | drivers/pnp/interface.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c index c3f1c8e9d254..68b0c04987e4 100644 --- a/drivers/pnp/interface.c +++ b/drivers/pnp/interface.c | |||
@@ -310,8 +310,7 @@ static ssize_t pnp_set_current_resources(struct device *dmdev, | |||
310 | goto done; | 310 | goto done; |
311 | } | 311 | } |
312 | 312 | ||
313 | while (isspace(*buf)) | 313 | buf = skip_spaces(buf); |
314 | ++buf; | ||
315 | if (!strnicmp(buf, "disable", 7)) { | 314 | if (!strnicmp(buf, "disable", 7)) { |
316 | retval = pnp_disable_dev(dev); | 315 | retval = pnp_disable_dev(dev); |
317 | goto done; | 316 | goto done; |
@@ -353,19 +352,13 @@ static ssize_t pnp_set_current_resources(struct device *dmdev, | |||
353 | pnp_init_resources(dev); | 352 | pnp_init_resources(dev); |
354 | mutex_lock(&pnp_res_mutex); | 353 | mutex_lock(&pnp_res_mutex); |
355 | while (1) { | 354 | while (1) { |
356 | while (isspace(*buf)) | 355 | buf = skip_spaces(buf); |
357 | ++buf; | ||
358 | if (!strnicmp(buf, "io", 2)) { | 356 | if (!strnicmp(buf, "io", 2)) { |
359 | buf += 2; | 357 | buf = skip_spaces(buf + 2); |
360 | while (isspace(*buf)) | ||
361 | ++buf; | ||
362 | start = simple_strtoul(buf, &buf, 0); | 358 | start = simple_strtoul(buf, &buf, 0); |
363 | while (isspace(*buf)) | 359 | buf = skip_spaces(buf); |
364 | ++buf; | ||
365 | if (*buf == '-') { | 360 | if (*buf == '-') { |
366 | buf += 1; | 361 | buf = skip_spaces(buf + 1); |
367 | while (isspace(*buf)) | ||
368 | ++buf; | ||
369 | end = simple_strtoul(buf, &buf, 0); | 362 | end = simple_strtoul(buf, &buf, 0); |
370 | } else | 363 | } else |
371 | end = start; | 364 | end = start; |
@@ -373,16 +366,11 @@ static ssize_t pnp_set_current_resources(struct device *dmdev, | |||
373 | continue; | 366 | continue; |
374 | } | 367 | } |
375 | if (!strnicmp(buf, "mem", 3)) { | 368 | if (!strnicmp(buf, "mem", 3)) { |
376 | buf += 3; | 369 | buf = skip_spaces(buf + 3); |
377 | while (isspace(*buf)) | ||
378 | ++buf; | ||
379 | start = simple_strtoul(buf, &buf, 0); | 370 | start = simple_strtoul(buf, &buf, 0); |
380 | while (isspace(*buf)) | 371 | buf = skip_spaces(buf); |
381 | ++buf; | ||
382 | if (*buf == '-') { | 372 | if (*buf == '-') { |
383 | buf += 1; | 373 | buf = skip_spaces(buf + 1); |
384 | while (isspace(*buf)) | ||
385 | ++buf; | ||
386 | end = simple_strtoul(buf, &buf, 0); | 374 | end = simple_strtoul(buf, &buf, 0); |
387 | } else | 375 | } else |
388 | end = start; | 376 | end = start; |
@@ -390,17 +378,13 @@ static ssize_t pnp_set_current_resources(struct device *dmdev, | |||
390 | continue; | 378 | continue; |
391 | } | 379 | } |
392 | if (!strnicmp(buf, "irq", 3)) { | 380 | if (!strnicmp(buf, "irq", 3)) { |
393 | buf += 3; | 381 | buf = skip_spaces(buf + 3); |
394 | while (isspace(*buf)) | ||
395 | ++buf; | ||
396 | start = simple_strtoul(buf, &buf, 0); | 382 | start = simple_strtoul(buf, &buf, 0); |
397 | pnp_add_irq_resource(dev, start, 0); | 383 | pnp_add_irq_resource(dev, start, 0); |
398 | continue; | 384 | continue; |
399 | } | 385 | } |
400 | if (!strnicmp(buf, "dma", 3)) { | 386 | if (!strnicmp(buf, "dma", 3)) { |
401 | buf += 3; | 387 | buf = skip_spaces(buf + 3); |
402 | while (isspace(*buf)) | ||
403 | ++buf; | ||
404 | start = simple_strtoul(buf, &buf, 0); | 388 | start = simple_strtoul(buf, &buf, 0); |
405 | pnp_add_dma_resource(dev, start, 0); | 389 | pnp_add_dma_resource(dev, start, 0); |
406 | continue; | 390 | continue; |