[PATCH 35/52] kstrtox: convert drivers/regulator/
From: Alexey Dobriyan
Date: Sat Feb 05 2011 - 09:22:36 EST
Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
---
drivers/regulator/virtual.c | 32 ++++++++++++++++++++------------
1 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c
index 69e550f..6e3eee2 100644
--- a/drivers/regulator/virtual.c
+++ b/drivers/regulator/virtual.c
@@ -118,10 +118,12 @@ static ssize_t set_min_uV(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct virtual_consumer_data *data = dev_get_drvdata(dev);
- long val;
+ int val;
+ int rv;
- if (strict_strtol(buf, 10, &val) != 0)
- return count;
+ rv = kstrtoint(buf, 10, &val);
+ if (rv < 0)
+ return rv;
mutex_lock(&data->lock);
@@ -144,10 +146,12 @@ static ssize_t set_max_uV(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct virtual_consumer_data *data = dev_get_drvdata(dev);
- long val;
+ int val;
+ int rv;
- if (strict_strtol(buf, 10, &val) != 0)
- return count;
+ rv = kstrtoint(buf, 10, &val);
+ if (rv < 0)
+ return rv;
mutex_lock(&data->lock);
@@ -170,10 +174,12 @@ static ssize_t set_min_uA(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct virtual_consumer_data *data = dev_get_drvdata(dev);
- long val;
+ int val;
+ int rv;
- if (strict_strtol(buf, 10, &val) != 0)
- return count;
+ rv = kstrtoint(buf, 10, &val);
+ if (rv < 0)
+ return rv;
mutex_lock(&data->lock);
@@ -196,10 +202,12 @@ static ssize_t set_max_uA(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct virtual_consumer_data *data = dev_get_drvdata(dev);
- long val;
+ int val;
+ int rv;
- if (strict_strtol(buf, 10, &val) != 0)
- return count;
+ rv = kstrtoint(buf, 10, &val);
+ if (rv < 0)
+ return rv;
mutex_lock(&data->lock);
--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/