diff options
Diffstat (limited to 'drivers/staging/iio/meter')
-rw-r--r-- | drivers/staging/iio/meter/ade7753.c | 10 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7754.c | 8 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7758_core.c | 6 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7759.c | 10 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7854-spi.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7854.c | 6 |
6 files changed, 21 insertions, 21 deletions
diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c index ffc7f0ddff14..188830d7e257 100644 --- a/drivers/staging/iio/meter/ade7753.c +++ b/drivers/staging/iio/meter/ade7753.c @@ -219,7 +219,7 @@ static int ade7753_reset(struct device *dev) u16 val; ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val); - val |= 1 << 6; /* Software Chip Reset */ + val |= BIT(6); /* Software Chip Reset */ return ade7753_spi_write_reg_16(dev, ADE7753_MODE, val); } @@ -328,10 +328,10 @@ static int ade7753_set_irq(struct device *dev, bool enable) goto error_ret; if (enable) - irqen |= 1 << 3; /* Enables an interrupt when a data is + irqen |= BIT(3); /* Enables an interrupt when a data is present in the waveform register */ else - irqen &= ~(1 << 3); + irqen &= ~BIT(3); ret = ade7753_spi_write_reg_8(dev, ADE7753_IRQEN, irqen); @@ -345,7 +345,7 @@ static int ade7753_stop_device(struct device *dev) u16 val; ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val); - val |= 1 << 4; /* AD converters can be turned off */ + val |= BIT(4); /* AD converters can be turned off */ return ade7753_spi_write_reg_16(dev, ADE7753_MODE, val); } @@ -406,7 +406,7 @@ static ssize_t ade7753_write_frequency(struct device *dev, ret = kstrtou16(buf, 10, &val); if (ret) return ret; - if (val == 0) + if (!val) return -EINVAL; mutex_lock(&indio_dev->mlock); diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c index f12b2e50329b..664c6e5f76b1 100644 --- a/drivers/staging/iio/meter/ade7754.c +++ b/drivers/staging/iio/meter/ade7754.c @@ -223,7 +223,7 @@ static int ade7754_reset(struct device *dev) if (ret < 0) return ret; - val |= 1 << 6; /* Software Chip Reset */ + val |= BIT(6); /* Software Chip Reset */ return ade7754_spi_write_reg_8(dev, ADE7754_OPMODE, val); } @@ -350,10 +350,10 @@ static int ade7754_set_irq(struct device *dev, bool enable) goto error_ret; if (enable) - irqen |= 1 << 14; /* Enables an interrupt when a data is + irqen |= BIT(14); /* Enables an interrupt when a data is present in the waveform register */ else - irqen &= ~(1 << 14); + irqen &= ~BIT(14); ret = ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen); if (ret) @@ -438,7 +438,7 @@ static ssize_t ade7754_write_frequency(struct device *dev, ret = kstrtou16(buf, 10, &val); if (ret) return ret; - if (val == 0) + if (!val) return -EINVAL; mutex_lock(&indio_dev->mlock); diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c index 77141ae1349d..38838085824f 100644 --- a/drivers/staging/iio/meter/ade7758_core.c +++ b/drivers/staging/iio/meter/ade7758_core.c @@ -308,7 +308,7 @@ static int ade7758_reset(struct device *dev) dev_err(dev, "Failed to read opmode reg\n"); return ret; } - val |= 1 << 6; /* Software Chip Reset */ + val |= BIT(6); /* Software Chip Reset */ ret = ade7758_spi_write_reg_8(dev, ADE7758_OPMODE, val); if (ret < 0) dev_err(dev, "Failed to write opmode reg\n"); @@ -426,10 +426,10 @@ int ade7758_set_irq(struct device *dev, bool enable) goto error_ret; if (enable) - irqen |= 1 << 16; /* Enables an interrupt when a data is + irqen |= BIT(16); /* Enables an interrupt when a data is present in the waveform register */ else - irqen &= ~(1 << 16); + irqen &= ~BIT(16); ret = ade7758_spi_write_reg_24(dev, ADE7758_MASK, irqen); if (ret) diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c index dbceda1e67ea..11c1edcc1ed6 100644 --- a/drivers/staging/iio/meter/ade7759.c +++ b/drivers/staging/iio/meter/ade7759.c @@ -224,7 +224,7 @@ static int ade7759_reset(struct device *dev) if (ret < 0) return ret; - val |= 1 << 6; /* Software Chip Reset */ + val |= BIT(6); /* Software Chip Reset */ return ade7759_spi_write_reg_16(dev, ADE7759_MODE, val); @@ -288,10 +288,10 @@ static int ade7759_set_irq(struct device *dev, bool enable) goto error_ret; if (enable) - irqen |= 1 << 3; /* Enables an interrupt when a data is + irqen |= BIT(3); /* Enables an interrupt when a data is present in the waveform register */ else - irqen &= ~(1 << 3); + irqen &= ~BIT(3); ret = ade7759_spi_write_reg_8(dev, ADE7759_IRQEN, irqen); @@ -314,7 +314,7 @@ static int ade7759_stop_device(struct device *dev) return ret; } - val |= 1 << 4; /* AD converters can be turned off */ + val |= BIT(4); /* AD converters can be turned off */ return ade7759_spi_write_reg_16(dev, ADE7759_MODE, val); } @@ -377,7 +377,7 @@ static ssize_t ade7759_write_frequency(struct device *dev, ret = kstrtou16(buf, 10, &val); if (ret) return ret; - if (val == 0) + if (!val) return -EINVAL; mutex_lock(&indio_dev->mlock); diff --git a/drivers/staging/iio/meter/ade7854-spi.c b/drivers/staging/iio/meter/ade7854-spi.c index 9b255a5f62c3..da774866512c 100644 --- a/drivers/staging/iio/meter/ade7854-spi.c +++ b/drivers/staging/iio/meter/ade7854-spi.c @@ -278,7 +278,7 @@ static int ade7854_spi_probe(struct spi_device *spi) struct iio_dev *indio_dev; indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); - if (indio_dev == NULL) + if (!indio_dev) return -ENOMEM; st = iio_priv(indio_dev); spi_set_drvdata(spi, indio_dev); diff --git a/drivers/staging/iio/meter/ade7854.c b/drivers/staging/iio/meter/ade7854.c index d620bbd603a3..a83883596dbc 100644 --- a/drivers/staging/iio/meter/ade7854.c +++ b/drivers/staging/iio/meter/ade7854.c @@ -181,7 +181,7 @@ static int ade7854_reset(struct device *dev) u16 val; st->read_reg_16(dev, ADE7854_CONFIG, &val); - val |= 1 << 7; /* Software Chip Reset */ + val |= BIT(7); /* Software Chip Reset */ return st->write_reg_16(dev, ADE7854_CONFIG, val); } @@ -420,10 +420,10 @@ static int ade7854_set_irq(struct device *dev, bool enable) goto error_ret; if (enable) - irqen |= 1 << 17; /* 1: interrupt enabled when all periodical + irqen |= BIT(17); /* 1: interrupt enabled when all periodical (at 8 kHz rate) DSP computations finish. */ else - irqen &= ~(1 << 17); + irqen &= ~BIT(17); ret = st->write_reg_32(dev, ADE7854_MASK0, irqen); if (ret) |