From: Peter Meerwald Date: Sat, 6 Dec 2014 06:00:00 +0000 (+0000) Subject: iio:adc:ad5504: Use BIT() and GENMASK() macros X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a476bc02eb4365d02ac71f20b5034e2437691e3f;p=linux-beck.git iio:adc:ad5504: Use BIT() and GENMASK() macros Signed-off-by: Peter Meerwald Acked-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c index 1e6449346b50..c917dd24090a 100644 --- a/drivers/iio/dac/ad5504.c +++ b/drivers/iio/dac/ad5504.c @@ -15,17 +15,16 @@ #include #include #include +#include #include #include #include #include -#define AD5505_BITS 12 -#define AD5504_RES_MASK ((1 << (AD5505_BITS)) - 1) - -#define AD5504_CMD_READ (1 << 15) -#define AD5504_CMD_WRITE (0 << 15) +#define AD5504_RES_MASK GENMASK(11, 0) +#define AD5504_CMD_READ BIT(15) +#define AD5504_CMD_WRITE 0 #define AD5504_ADDR(addr) ((addr) << 12) /* Registers */ @@ -42,7 +41,7 @@ /** * struct ad5446_state - driver instance specific data - * @us: spi_device + * @spi: spi_device * @reg: supply regulator * @vref_mv: actual reference voltage used * @pwr_down_mask power down mask