aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-06-04 00:11:50 -0400
committerLee Jones <lee.jones@linaro.org>2013-06-13 05:51:56 -0400
commit8420a24138e4ad7a8351bef136139ecb27cb15c5 (patch)
treec18f945c0fdd41ff83702c6654166748506dea72
parentfccf14ad1e4f09a4033908ead9bf3f393979d54b (diff)
mfd: Replace strict_strtoul() with kstrtoul() in ab* and att*
The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r--drivers/mfd/aat2870-core.c5
-rw-r--r--drivers/mfd/ab3100-core.c28
-rw-r--r--drivers/mfd/ab8500-debugfs.c2
3 files changed, 14 insertions, 21 deletions
diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index dfdb0a2b6835..d4f594517521 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -312,8 +312,9 @@ static ssize_t aat2870_reg_write_file(struct file *file,
312 while (*start == ' ') 312 while (*start == ' ')
313 start++; 313 start++;
314 314
315 if (strict_strtoul(start, 16, &val)) 315 ret = kstrtoul(start, 16, &val);
316 return -EINVAL; 316 if (ret)
317 return ret;
317 318
318 ret = aat2870->write(aat2870, (u8)addr, (u8)val); 319 ret = aat2870->write(aat2870, (u8)addr, (u8)val);
319 if (ret) 320 if (ret)
diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
index a9bb140bc86b..ddc669d19530 100644
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -491,7 +491,7 @@ static ssize_t ab3100_get_set_reg(struct file *file,
491 char buf[32]; 491 char buf[32];
492 ssize_t buf_size; 492 ssize_t buf_size;
493 int regp; 493 int regp;
494 unsigned long user_reg; 494 u8 user_reg;
495 int err; 495 int err;
496 int i = 0; 496 int i = 0;
497 497
@@ -514,34 +514,29 @@ static ssize_t ab3100_get_set_reg(struct file *file,
514 /* 514 /*
515 * Advance pointer to end of string then terminate 515 * Advance pointer to end of string then terminate
516 * the register string. This is needed to satisfy 516 * the register string. This is needed to satisfy
517 * the strict_strtoul() function. 517 * the kstrtou8() function.
518 */ 518 */
519 while ((i < buf_size) && (buf[i] != ' ')) 519 while ((i < buf_size) && (buf[i] != ' '))
520 i++; 520 i++;
521 buf[i] = '\0'; 521 buf[i] = '\0';
522 522
523 err = strict_strtoul(&buf[regp], 16, &user_reg); 523 err = kstrtou8(&buf[regp], 16, &user_reg);
524 if (err) 524 if (err)
525 return err; 525 return err;
526 if (user_reg > 0xff)
527 return -EINVAL;
528 526
529 /* Either we read or we write a register here */ 527 /* Either we read or we write a register here */
530 if (!priv->mode) { 528 if (!priv->mode) {
531 /* Reading */ 529 /* Reading */
532 u8 reg = (u8) user_reg;
533 u8 regvalue; 530 u8 regvalue;
534 531
535 ab3100_get_register_interruptible(ab3100, reg, &regvalue); 532 ab3100_get_register_interruptible(ab3100, user_reg, &regvalue);
536 533
537 dev_info(ab3100->dev, 534 dev_info(ab3100->dev,
538 "debug read AB3100 reg[0x%02x]: 0x%02x\n", 535 "debug read AB3100 reg[0x%02x]: 0x%02x\n",
539 reg, regvalue); 536 user_reg, regvalue);
540 } else { 537 } else {
541 int valp; 538 int valp;
542 unsigned long user_value; 539 u8 user_value;
543 u8 reg = (u8) user_reg;
544 u8 value;
545 u8 regvalue; 540 u8 regvalue;
546 541
547 /* 542 /*
@@ -557,20 +552,17 @@ static ssize_t ab3100_get_set_reg(struct file *file,
557 i++; 552 i++;
558 buf[i] = '\0'; 553 buf[i] = '\0';
559 554
560 err = strict_strtoul(&buf[valp], 16, &user_value); 555 err = kstrtou8(&buf[valp], 16, &user_value);
561 if (err) 556 if (err)
562 return err; 557 return err;
563 if (user_reg > 0xff)
564 return -EINVAL;
565 558
566 value = (u8) user_value; 559 ab3100_set_register_interruptible(ab3100, user_reg, user_value);
567 ab3100_set_register_interruptible(ab3100, reg, value); 560 ab3100_get_register_interruptible(ab3100, user_reg, &regvalue);
568 ab3100_get_register_interruptible(ab3100, reg, &regvalue);
569 561
570 dev_info(ab3100->dev, 562 dev_info(ab3100->dev,
571 "debug write reg[0x%02x] with 0x%02x, " 563 "debug write reg[0x%02x] with 0x%02x, "
572 "after readback: 0x%02x\n", 564 "after readback: 0x%02x\n",
573 reg, value, regvalue); 565 user_reg, user_value, regvalue);
574 } 566 }
575 return buf_size; 567 return buf_size;
576} 568}
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 37b7ce4c7c3b..11656c2c63cb 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -2757,7 +2757,7 @@ static ssize_t show_irq(struct device *dev,
2757 unsigned int irq_index; 2757 unsigned int irq_index;
2758 int err; 2758 int err;
2759 2759
2760 err = strict_strtoul(attr->attr.name, 0, &name); 2760 err = kstrtoul(attr->attr.name, 0, &name);
2761 if (err) 2761 if (err)
2762 return err; 2762 return err;
2763 2763