]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging:iio:accel:lis3l02dq unwind use of IIO_CHAN macro.
authorJonathan Cameron <jic23@kernel.org>
Fri, 13 Apr 2012 09:42:52 +0000 (10:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2012 18:08:03 +0000 (11:08 -0700)
This macro is being removed to simplify ongoing maintenance
so we need to unwind and remaining users.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/accel/lis3l02dq_core.c

index bcf47123dd6dfca15145827b6e8baaaf527d685c..0bb7c70bc30ce3a0620d7661b2793bf68d7f2d55 100644 (file)
@@ -521,13 +521,26 @@ static irqreturn_t lis3l02dq_event_handler(int irq, void *private)
        (IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING) |    \
         IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING))
 
+#define LIS3L02DQ_CHAN(index, mod)                             \
+       {                                                       \
+               .type = IIO_ACCEL,                              \
+               .modified = 1,                                  \
+               .channel2 = mod,                                \
+               .info_mask =  LIS3L02DQ_INFO_MASK,              \
+               .address = index,                               \
+               .scan_index = index,                            \
+               .scan_type = {                                  \
+                       .sign = 's',                            \
+                       .realbits = 12,                         \
+                       .storagebits = 16,                      \
+               },                                              \
+               .event_mask = LIS3L02DQ_EVENT_MASK,             \
+        }
+
 static struct iio_chan_spec lis3l02dq_channels[] = {
-       IIO_CHAN(IIO_ACCEL, 1, 0, 0, NULL, 0, IIO_MOD_X, LIS3L02DQ_INFO_MASK,
-                0, 0, IIO_ST('s', 12, 16, 0), LIS3L02DQ_EVENT_MASK),
-       IIO_CHAN(IIO_ACCEL, 1, 0, 0, NULL, 0, IIO_MOD_Y, LIS3L02DQ_INFO_MASK,
-                1, 1, IIO_ST('s', 12, 16, 0), LIS3L02DQ_EVENT_MASK),
-       IIO_CHAN(IIO_ACCEL, 1, 0, 0, NULL, 0, IIO_MOD_Z, LIS3L02DQ_INFO_MASK,
-                2, 2, IIO_ST('s', 12, 16, 0), LIS3L02DQ_EVENT_MASK),
+       LIS3L02DQ_CHAN(0, IIO_MOD_X),
+       LIS3L02DQ_CHAN(1, IIO_MOD_Y),
+       LIS3L02DQ_CHAN(2, IIO_MOD_Z),
        IIO_CHAN_SOFT_TIMESTAMP(3)
 };