]> git.karo-electronics.de Git - linux-beck.git/commitdiff
iio:adc:ad5504: Use BIT() and GENMASK() macros
authorPeter Meerwald <pmeerw@pmeerw.net>
Sat, 6 Dec 2014 06:00:00 +0000 (06:00 +0000)
committerJonathan Cameron <jic23@kernel.org>
Sat, 14 Jun 2014 14:48:24 +0000 (15:48 +0100)
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/dac/ad5504.c

index 1e6449346b50868fadecda845b1f19af46a16c40..c917dd24090a01ff32b4c695b3fed39373a8e2b4 100644 (file)
 #include <linux/sysfs.h>
 #include <linux/regulator/consumer.h>
 #include <linux/module.h>
+#include <linux/bitops.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 #include <linux/iio/events.h>
 #include <linux/iio/dac/ad5504.h>
 
-#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