Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7b41276 authored by Jingoo Han's avatar Jingoo Han Committed by Greg Kroah-Hartman
Browse files

misc: replace strict_strtoul() with kstrtoul()



The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.

Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4cd5773a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -470,7 +470,7 @@ static ssize_t sysfs_set_reg(struct device *dev,
		!test_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask))
		return -EPERM;

	err = strict_strtoul(buf, 10, &value);
	err = kstrtoul(buf, 10, &value);
	if (err)
		return err;

+3 −2
Original line number Diff line number Diff line
@@ -126,8 +126,9 @@ static ssize_t als_sensing_range_store(struct device *dev,
	int ret_val;
	unsigned long val;

	if (strict_strtoul(buf, 10, &val))
		return -EINVAL;
	ret_val = kstrtoul(buf, 10, &val);
	if (ret_val)
		return ret_val;

	if (val < 4096)
		val = 1;
+24 −13
Original line number Diff line number Diff line
@@ -696,9 +696,11 @@ static ssize_t apds990x_lux_calib_store(struct device *dev,
{
	struct apds990x_chip *chip = dev_get_drvdata(dev);
	unsigned long value;
	int ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	chip->lux_calib = value;

@@ -759,8 +761,9 @@ static ssize_t apds990x_rate_store(struct device *dev,
	unsigned long value;
	int ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	mutex_lock(&chip->mutex);
	ret = apds990x_set_arate(chip, value);
@@ -813,9 +816,11 @@ static ssize_t apds990x_prox_enable_store(struct device *dev,
{
	struct apds990x_chip *chip =  dev_get_drvdata(dev);
	unsigned long value;
	int ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	mutex_lock(&chip->mutex);

@@ -892,11 +897,12 @@ static ssize_t apds990x_lux_thresh_below_show(struct device *dev,
static ssize_t apds990x_set_lux_thresh(struct apds990x_chip *chip, u32 *target,
				const char *buf)
{
	int ret = 0;
	unsigned long thresh;
	int ret;

	if (strict_strtoul(buf, 0, &thresh))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &thresh);
	if (ret)
		return ret;

	if (thresh > APDS_RANGE)
		return -EINVAL;
@@ -957,9 +963,11 @@ static ssize_t apds990x_prox_threshold_store(struct device *dev,
{
	struct apds990x_chip *chip =  dev_get_drvdata(dev);
	unsigned long value;
	int ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	if ((value > APDS_RANGE) || (value == 0) ||
		(value < APDS_PROX_HYSTERESIS))
@@ -990,9 +998,12 @@ static ssize_t apds990x_power_state_store(struct device *dev,
{
	struct apds990x_chip *chip =  dev_get_drvdata(dev);
	unsigned long value;
	int ret;

	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	if (value) {
		pm_runtime_get_sync(dev);
		mutex_lock(&chip->mutex);
+38 −21
Original line number Diff line number Diff line
@@ -651,8 +651,9 @@ static ssize_t bh1770_power_state_store(struct device *dev,
	unsigned long value;
	ssize_t ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	mutex_lock(&chip->mutex);
	if (value) {
@@ -726,9 +727,11 @@ static ssize_t bh1770_prox_enable_store(struct device *dev,
{
	struct bh1770_chip *chip =  dev_get_drvdata(dev);
	unsigned long value;
	int ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	mutex_lock(&chip->mutex);
	/* Assume no proximity. Sensor will tell real state soon */
@@ -824,9 +827,11 @@ static ssize_t bh1770_set_prox_rate_above(struct device *dev,
{
	struct bh1770_chip *chip =  dev_get_drvdata(dev);
	unsigned long value;
	int ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	mutex_lock(&chip->mutex);
	chip->prox_rate_threshold = bh1770_prox_rate_validate(value);
@@ -840,9 +845,11 @@ static ssize_t bh1770_set_prox_rate_below(struct device *dev,
{
	struct bh1770_chip *chip =  dev_get_drvdata(dev);
	unsigned long value;
	int ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	mutex_lock(&chip->mutex);
	chip->prox_rate = bh1770_prox_rate_validate(value);
@@ -865,8 +872,10 @@ static ssize_t bh1770_set_prox_thres(struct device *dev,
	unsigned long value;
	int ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	if (value > BH1770_PROX_RANGE)
		return -EINVAL;

@@ -893,9 +902,11 @@ static ssize_t bh1770_prox_persistence_store(struct device *dev,
{
	struct bh1770_chip *chip = dev_get_drvdata(dev);
	unsigned long value;
	int ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	if (value > BH1770_PROX_MAX_PERSISTENCE)
		return -EINVAL;
@@ -918,9 +929,11 @@ static ssize_t bh1770_prox_abs_thres_store(struct device *dev,
{
	struct bh1770_chip *chip = dev_get_drvdata(dev);
	unsigned long value;
	int ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	if (value > BH1770_PROX_RANGE)
		return -EINVAL;
@@ -963,9 +976,11 @@ static ssize_t bh1770_lux_calib_store(struct device *dev,
	unsigned long value;
	u32 old_calib;
	u32 new_corr;
	int ret;

	if (strict_strtoul(buf, 0, &value))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &value);
	if (ret)
		return ret;

	mutex_lock(&chip->mutex);
	old_calib = chip->lux_calib;
@@ -1012,8 +1027,9 @@ static ssize_t bh1770_set_lux_rate(struct device *dev,
	unsigned long rate_hz;
	int ret, i;

	if (strict_strtoul(buf, 0, &rate_hz))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &rate_hz);
	if (ret)
		return ret;

	for (i = 0; i < ARRAY_SIZE(lux_rates_hz) - 1; i++)
		if (rate_hz >= lux_rates_hz[i])
@@ -1047,11 +1063,12 @@ static ssize_t bh1770_get_lux_thresh_below(struct device *dev,
static ssize_t bh1770_set_lux_thresh(struct bh1770_chip *chip, u16 *target,
				const char *buf)
{
	int ret = 0;
	unsigned long thresh;
	int ret;

	if (strict_strtoul(buf, 0, &thresh))
		return -EINVAL;
	ret = kstrtoul(buf, 0, &thresh);
	if (ret)
		return ret;

	if (thresh > BH1770_LUX_RANGE)
		return -EINVAL;
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ static ssize_t bh1780_store_power_state(struct device *dev,
	unsigned long val;
	int error;

	error = strict_strtoul(buf, 0, &val);
	error = kstrtoul(buf, 0, &val);
	if (error)
		return error;

Loading