|
@@ -412,13 +412,13 @@ static ssize_t adt7316_store_ad_channel(struct device *dev,
|
|
|
struct iio_dev *dev_info = dev_to_iio_dev(dev);
|
|
|
struct adt7316_chip_info *chip = iio_priv(dev_info);
|
|
|
u8 config2;
|
|
|
- unsigned long data = 0;
|
|
|
+ u8 data;
|
|
|
int ret;
|
|
|
|
|
|
if (!(chip->config2 & ADT7316_AD_SINGLE_CH_MODE))
|
|
|
return -EPERM;
|
|
|
|
|
|
- ret = strict_strtoul(buf, 10, &data);
|
|
|
+ ret = kstrtou8(buf, 10, &data);
|
|
|
if (ret)
|
|
|
return -EINVAL;
|
|
|
|
|
@@ -823,10 +823,10 @@ static ssize_t adt7316_store_DAC_2Vref_ch_mask(struct device *dev,
|
|
|
struct iio_dev *dev_info = dev_to_iio_dev(dev);
|
|
|
struct adt7316_chip_info *chip = iio_priv(dev_info);
|
|
|
u8 dac_config;
|
|
|
- unsigned long data = 0;
|
|
|
+ u8 data;
|
|
|
int ret;
|
|
|
|
|
|
- ret = strict_strtoul(buf, 16, &data);
|
|
|
+ ret = kstrtou8(buf, 16, &data);
|
|
|
if (ret || data > ADT7316_DA_2VREF_CH_MASK)
|
|
|
return -EINVAL;
|
|
|
|
|
@@ -878,13 +878,13 @@ static ssize_t adt7316_store_DAC_update_mode(struct device *dev,
|
|
|
struct iio_dev *dev_info = dev_to_iio_dev(dev);
|
|
|
struct adt7316_chip_info *chip = iio_priv(dev_info);
|
|
|
u8 dac_config;
|
|
|
- unsigned long data;
|
|
|
+ u8 data;
|
|
|
int ret;
|
|
|
|
|
|
if (!(chip->config3 & ADT7316_DA_EN_VIA_DAC_LDCA))
|
|
|
return -EPERM;
|
|
|
|
|
|
- ret = strict_strtoul(buf, 10, &data);
|
|
|
+ ret = kstrtou8(buf, 10, &data);
|
|
|
if (ret || data > ADT7316_DA_EN_MODE_MASK)
|
|
|
return -EINVAL;
|
|
|
|
|
@@ -933,7 +933,7 @@ static ssize_t adt7316_store_update_DAC(struct device *dev,
|
|
|
struct iio_dev *dev_info = dev_to_iio_dev(dev);
|
|
|
struct adt7316_chip_info *chip = iio_priv(dev_info);
|
|
|
u8 ldac_config;
|
|
|
- unsigned long data;
|
|
|
+ u8 data;
|
|
|
int ret;
|
|
|
|
|
|
if (chip->config3 & ADT7316_DA_EN_VIA_DAC_LDCA) {
|
|
@@ -941,7 +941,7 @@ static ssize_t adt7316_store_update_DAC(struct device *dev,
|
|
|
ADT7316_DA_EN_MODE_LDAC)
|
|
|
return -EPERM;
|
|
|
|
|
|
- ret = strict_strtoul(buf, 16, &data);
|
|
|
+ ret = kstrtou8(buf, 16, &data);
|
|
|
if (ret || data > ADT7316_LDAC_EN_DA_MASK)
|
|
|
return -EINVAL;
|
|
|
|
|
@@ -1079,11 +1079,11 @@ static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev,
|
|
|
struct iio_dev *dev_info = dev_to_iio_dev(dev);
|
|
|
struct adt7316_chip_info *chip = iio_priv(dev_info);
|
|
|
u8 ldac_config;
|
|
|
- unsigned long data;
|
|
|
+ u8 data;
|
|
|
int ret;
|
|
|
|
|
|
if ((chip->id & ID_FAMILY_MASK) == ID_ADT75XX) {
|
|
|
- ret = strict_strtoul(buf, 16, &data);
|
|
|
+ ret = kstrtou8(buf, 16, &data);
|
|
|
if (ret || data > 3)
|
|
|
return -EINVAL;
|
|
|
|
|
@@ -1093,7 +1093,7 @@ static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev,
|
|
|
else if (data & 0x2)
|
|
|
ldac_config |= ADT7516_DAC_CD_IN_VREF;
|
|
|
} else {
|
|
|
- ret = strict_strtoul(buf, 16, &data);
|
|
|
+ ret = kstrtou8(buf, 16, &data);
|
|
|
if (ret)
|
|
|
return -EINVAL;
|
|
|
|
|
@@ -1281,11 +1281,11 @@ static ssize_t adt7316_show_temp_offset(struct adt7316_chip_info *chip,
|
|
|
static ssize_t adt7316_store_temp_offset(struct adt7316_chip_info *chip,
|
|
|
int offset_addr, const char *buf, size_t len)
|
|
|
{
|
|
|
- long data;
|
|
|
+ int data;
|
|
|
u8 val;
|
|
|
int ret;
|
|
|
|
|
|
- ret = strict_strtol(buf, 10, &data);
|
|
|
+ ret = kstrtoint(buf, 10, &data);
|
|
|
if (ret || data > 127 || data < -128)
|
|
|
return -EINVAL;
|
|
|
|
|
@@ -1442,7 +1442,7 @@ static ssize_t adt7316_store_DAC(struct adt7316_chip_info *chip,
|
|
|
int channel, const char *buf, size_t len)
|
|
|
{
|
|
|
u8 msb, lsb, offset;
|
|
|
- unsigned long data;
|
|
|
+ u16 data;
|
|
|
int ret;
|
|
|
|
|
|
if (channel >= ADT7316_DA_MSB_DATA_REGS ||
|
|
@@ -1454,7 +1454,7 @@ static ssize_t adt7316_store_DAC(struct adt7316_chip_info *chip,
|
|
|
|
|
|
offset = chip->dac_bits - 8;
|
|
|
|
|
|
- ret = strict_strtoul(buf, 10, &data);
|
|
|
+ ret = kstrtou16(buf, 10, &data);
|
|
|
if (ret || data >= (1 << chip->dac_bits))
|
|
|
return -EINVAL;
|
|
|
|
|
@@ -1830,11 +1830,11 @@ static ssize_t adt7316_set_int_mask(struct device *dev,
|
|
|
{
|
|
|
struct iio_dev *dev_info = dev_to_iio_dev(dev);
|
|
|
struct adt7316_chip_info *chip = iio_priv(dev_info);
|
|
|
- unsigned long data;
|
|
|
+ u16 data;
|
|
|
int ret;
|
|
|
u8 mask;
|
|
|
|
|
|
- ret = strict_strtoul(buf, 16, &data);
|
|
|
+ ret = kstrtou16(buf, 16, &data);
|
|
|
if (ret || data >= ADT7316_VDD_INT_MASK + 1)
|
|
|
return -EINVAL;
|
|
|
|
|
@@ -1901,7 +1901,7 @@ static inline ssize_t adt7316_set_ad_bound(struct device *dev,
|
|
|
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
|
|
|
struct iio_dev *dev_info = dev_to_iio_dev(dev);
|
|
|
struct adt7316_chip_info *chip = iio_priv(dev_info);
|
|
|
- long data;
|
|
|
+ int data;
|
|
|
u8 val;
|
|
|
int ret;
|
|
|
|
|
@@ -1909,7 +1909,7 @@ static inline ssize_t adt7316_set_ad_bound(struct device *dev,
|
|
|
this_attr->address > ADT7316_EX_TEMP_LOW)
|
|
|
return -EPERM;
|
|
|
|
|
|
- ret = strict_strtol(buf, 10, &data);
|
|
|
+ ret = kstrtoint(buf, 10, &data);
|
|
|
if (ret)
|
|
|
return -EINVAL;
|
|
|
|