X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fstaging%2Fiio%2Flight%2Ftsl2583.c;h=3100d960fe2c6dc57a49361dcbd5ce53c00e9ef0;hb=cecd4cfb540ed627fba81a0c4d92e205ed8314e6;hp=df602038a4bd062549b1dd50cc637dc66ddf7874;hpb=5da654541bb3cccaa480e8998f1bb770126341f1;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index df602038a4bd..3100d960fe2c 100644 --- a/drivers/staging/iio/light/tsl2583.c +++ b/drivers/staging/iio/light/tsl2583.c @@ -263,7 +263,7 @@ static int taos_get_lux(struct iio_dev *indio_dev) if ((ch0 >= chip->als_saturation) || (ch1 >= chip->als_saturation)) goto return_max; - if (ch0 == 0) { + if (!ch0) { /* have no data, so return LAST VALUE */ ret = chip->als_cur_info.lux = 0; goto out_unlock; @@ -415,7 +415,7 @@ static int taos_chip_on(struct iio_dev *indio_dev) /* determine als integration register */ als_count = (chip->taos_settings.als_time * 100 + 135) / 270; - if (als_count == 0) + if (!als_count) als_count = 1; /* ensure at least one cycle */ /* convert back to time (encompasses overrides) */ @@ -499,7 +499,7 @@ static ssize_t taos_power_state_store(struct device *dev, if (kstrtoint(buf, 0, &value)) return -EINVAL; - if (value == 0) + if (!value) taos_chip_off(indio_dev); else taos_chip_on(indio_dev);