Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363969
b: refs/heads/master
c: 9f16778
h: refs/heads/master
i:
  363967: d8f99b2
v: v3
  • Loading branch information
Luck, Tony authored and Jonathan Cameron committed Apr 9, 2013
1 parent 587a91f commit d055642
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5993f3a2692eed3c74c86882155b8703a0060ad5
refs/heads/master: 9f16778c5d0a32f264812a9bf1602b71613720b8
26 changes: 13 additions & 13 deletions trunk/drivers/staging/iio/addac/adt7316.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ static ssize_t adt7316_store_enabled(struct device *dev,
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;
Expand Down Expand Up @@ -299,7 +299,7 @@ static ssize_t adt7316_store_select_ex_temp(struct device *dev,
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);
Expand Down Expand Up @@ -495,7 +495,7 @@ static ssize_t adt7316_store_disable_averaging(struct device *dev,
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);
Expand Down Expand Up @@ -534,7 +534,7 @@ static ssize_t adt7316_store_enable_smbus_timeout(struct device *dev,
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);
Expand Down Expand Up @@ -597,7 +597,7 @@ static ssize_t adt7316_store_powerdown(struct device *dev,
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);
Expand Down Expand Up @@ -635,7 +635,7 @@ static ssize_t adt7316_store_fast_ad_clock(struct device *dev,
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);
Expand Down Expand Up @@ -681,7 +681,7 @@ static ssize_t adt7316_store_da_high_resolution(struct device *dev,

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;
Expand Down Expand Up @@ -731,7 +731,7 @@ static ssize_t adt7316_store_AIN_internal_Vref(struct device *dev,
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;
Expand Down Expand Up @@ -773,7 +773,7 @@ static ssize_t adt7316_store_enable_prop_DACA(struct device *dev,
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);
Expand Down Expand Up @@ -812,7 +812,7 @@ static ssize_t adt7316_store_enable_prop_DACB(struct device *dev,
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);
Expand Down Expand Up @@ -1018,7 +1018,7 @@ static ssize_t adt7316_store_DA_AB_Vref_bypass(struct device *dev,
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);
Expand Down Expand Up @@ -1063,7 +1063,7 @@ static ssize_t adt7316_store_DA_CD_Vref_bypass(struct device *dev,
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);
Expand Down Expand Up @@ -1982,7 +1982,7 @@ static ssize_t adt7316_set_int_enabled(struct device *dev,
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);
Expand Down

0 comments on commit d055642

Please sign in to comment.