struct adt7316_chip_info *chip = iio_priv(dev_info);
int enable;
- if (!memcmp(buf, "1", 1))
+ if (buf[0] == '1')
enable = 1;
else
enable = 0;
return -EPERM;
config1 = chip->config1 & (~ADT7516_SEL_EX_TEMP);
- if (!memcmp(buf, "1", 1))
+ if (buf[0] == '1')
config1 |= ADT7516_SEL_EX_TEMP;
ret = chip->bus.write(chip->bus.client, ADT7316_CONFIG1, config1);
int ret;
config2 = chip->config2 & (~ADT7316_DISABLE_AVERAGING);
- if (!memcmp(buf, "1", 1))
+ if (buf[0] == '1')
config2 |= ADT7316_DISABLE_AVERAGING;
ret = chip->bus.write(chip->bus.client, ADT7316_CONFIG2, config2);
int ret;
config2 = chip->config2 & (~ADT7316_EN_SMBUS_TIMEOUT);
- if (!memcmp(buf, "1", 1))
+ if (buf[0] == '1')
config2 |= ADT7316_EN_SMBUS_TIMEOUT;
ret = chip->bus.write(chip->bus.client, ADT7316_CONFIG2, config2);
int ret;
config1 = chip->config1 & (~ADT7316_PD);
- if (!memcmp(buf, "1", 1))
+ if (buf[0] == '1')
config1 |= ADT7316_PD;
ret = chip->bus.write(chip->bus.client, ADT7316_CONFIG1, config1);
int ret;
config3 = chip->config3 & (~ADT7316_ADCLK_22_5);
- if (!memcmp(buf, "1", 1))
+ if (buf[0] == '1')
config3 |= ADT7316_ADCLK_22_5;
ret = chip->bus.write(chip->bus.client, ADT7316_CONFIG3, config3);
chip->dac_bits = 8;
- if (!memcmp(buf, "1", 1)) {
+ if (buf[0] == '1') {
config3 = chip->config3 | ADT7316_DA_HIGH_RESOLUTION;
if (chip->id == ID_ADT7316 || chip->id == ID_ADT7516)
chip->dac_bits = 12;
if ((chip->id & ID_FAMILY_MASK) != ID_ADT75XX)
return -EPERM;
- if (memcmp(buf, "1", 1))
+ if (buf[0] != '1')
config3 = chip->config3 & (~ADT7516_AIN_IN_VREF);
else
config3 = chip->config3 | ADT7516_AIN_IN_VREF;
int ret;
config3 = chip->config3 & (~ADT7316_EN_IN_TEMP_PROP_DACA);
- if (!memcmp(buf, "1", 1))
+ if (buf[0] == '1')
config3 |= ADT7316_EN_IN_TEMP_PROP_DACA;
ret = chip->bus.write(chip->bus.client, ADT7316_CONFIG3, config3);
int ret;
config3 = chip->config3 & (~ADT7316_EN_EX_TEMP_PROP_DACB);
- if (!memcmp(buf, "1", 1))
+ if (buf[0] == '1')
config3 |= ADT7316_EN_EX_TEMP_PROP_DACB;
ret = chip->bus.write(chip->bus.client, ADT7316_CONFIG3, config3);
return -EPERM;
dac_config = chip->dac_config & (~ADT7316_VREF_BYPASS_DAC_AB);
- if (!memcmp(buf, "1", 1))
+ if (buf[0] == '1')
dac_config |= ADT7316_VREF_BYPASS_DAC_AB;
ret = chip->bus.write(chip->bus.client, ADT7316_DAC_CONFIG, dac_config);
return -EPERM;
dac_config = chip->dac_config & (~ADT7316_VREF_BYPASS_DAC_CD);
- if (!memcmp(buf, "1", 1))
+ if (buf[0] == '1')
dac_config |= ADT7316_VREF_BYPASS_DAC_CD;
ret = chip->bus.write(chip->bus.client, ADT7316_DAC_CONFIG, dac_config);
int ret;
config1 = chip->config1 & (~ADT7316_INT_EN);
- if (!memcmp(buf, "1", 1))
+ if (buf[0] == '1')
config1 |= ADT7316_INT_EN;
ret = chip->bus.write(chip->bus.client, ADT7316_CONFIG1, config1);