diff options
Diffstat (limited to 'drivers/mfd/intel_soc_pmic_bxtwc.c')
-rw-r--r-- | drivers/mfd/intel_soc_pmic_bxtwc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c index 40acaff2e1c3..b9428767e615 100644 --- a/drivers/mfd/intel_soc_pmic_bxtwc.c +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c @@ -297,10 +297,9 @@ static ssize_t bxtwc_val_store(struct device *dev, unsigned int val; struct intel_soc_pmic *pmic = dev_get_drvdata(dev); - if (kstrtoul(buf, 0, (unsigned long *)&val)) { - dev_err(dev, "Invalid register value\n"); - return -EINVAL; - } + ret = kstrtouint(buf, 0, &val); + if (ret) + return ret; ret = regmap_write(pmic->regmap, bxtwc_reg_addr, val); if (ret) { |