diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-08-20 03:31:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-09-08 15:16:07 +0100 |
commit | e5e26dd5bb740c34c975e2ae059126ba3486a1ce (patch) | |
tree | ff5138e0044ef7f3f6c9bed9fbbeb3e10d5dbb81 /drivers/staging/iio/impedance-analyzer | |
parent | 07914c84ba30e311f6bfb65b811b33a1dc094311 (diff) | |
download | linux-stable-e5e26dd5bb740c34c975e2ae059126ba3486a1ce.tar.gz linux-stable-e5e26dd5bb740c34c975e2ae059126ba3486a1ce.tar.bz2 linux-stable-e5e26dd5bb740c34c975e2ae059126ba3486a1ce.zip |
staging: iio: replace strict_strto*() with kstrto*()
The usage of strict_strto*() is not preferred, because
strict_strto*() is obsolete. Thus, kstrto*() should be
used.
Previously, there were only strict_strtol(), strict_strtoul(),
strict_strtoull(), and strict_strtoll(). Thus, when converting
to the variables, only long, unsigned long, unsigned long long,
and long long can be used.
However, kstrto*() provides various functions handling all types
of variables. Therefore, the types of variables can be changed
properly.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/impedance-analyzer')
-rw-r--r-- | drivers/staging/iio/impedance-analyzer/ad5933.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c index 23a0d7179303..00f70679a2bd 100644 --- a/drivers/staging/iio/impedance-analyzer/ad5933.c +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c @@ -323,10 +323,10 @@ static ssize_t ad5933_store_frequency(struct device *dev, struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad5933_state *st = iio_priv(indio_dev); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); - long val; + unsigned long val; int ret; - ret = strict_strtoul(buf, 10, &val); + ret = kstrtoul(buf, 10, &val); if (ret) return ret; @@ -400,12 +400,12 @@ static ssize_t ad5933_store(struct device *dev, struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad5933_state *st = iio_priv(indio_dev); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); - long val; + u16 val; int i, ret = 0; unsigned short dat; if (this_attr->address != AD5933_IN_PGA_GAIN) { - ret = strict_strtol(buf, 10, &val); + ret = kstrtou16(buf, 10, &val); if (ret) return ret; } @@ -434,7 +434,7 @@ static ssize_t ad5933_store(struct device *dev, ret = ad5933_cmd(st, 0); break; case AD5933_OUT_SETTLING_CYCLES: - val = clamp(val, 0L, 0x7FFL); + val = clamp(val, (u16)0, (u16)0x7FF); st->settling_cycles = val; /* 2x, 4x handling, see datasheet */ @@ -448,7 +448,7 @@ static ssize_t ad5933_store(struct device *dev, AD5933_REG_SETTLING_CYCLES, 2, (u8 *)&dat); break; case AD5933_FREQ_POINTS: - val = clamp(val, 0L, 511L); + val = clamp(val, (u16)0, (u16)511); st->freq_points = val; dat = cpu_to_be16(val); |