]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/staging/iio/meter/ade7754.c
Merge tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
[mirror_ubuntu-artful-kernel.git] / drivers / staging / iio / meter / ade7754.c
index 5609872532f11b4a0a6fc8a5d69098dfabd48aea..1e950685e12f94bf3ee1864b9ff1b60a39845271 100644 (file)
@@ -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);