staging: iio: Make use of the convenient IIO_TRIGGER_NAME_ATTR macro
authorJonathan Cameron <jic23@cam.ac.uk>
Sat, 4 Sep 2010 16:54:48 +0000 (17:54 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 5 Sep 2010 04:19:01 +0000 (21:19 -0700)
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/accel/adis16209_trigger.c
drivers/staging/iio/accel/adis16240_trigger.c
drivers/staging/iio/accel/lis3l02dq_ring.c
drivers/staging/iio/gyro/adis16260_trigger.c
drivers/staging/iio/imu/adis16300_trigger.c
drivers/staging/iio/imu/adis16350_trigger.c
drivers/staging/iio/imu/adis16400_trigger.c
drivers/staging/iio/trigger/iio-trig-gpio.c
drivers/staging/iio/trigger/iio-trig-periodic-rtc.c

index 1487effa2e3007e61f85cb0536b9775339b87724..d2980dc74440ce995cf32f756becfdfd908bccdd 100644 (file)
@@ -30,7 +30,7 @@ static int adis16209_data_rdy_trig_poll(struct iio_dev *dev_info,
 
 IIO_EVENT_SH(data_rdy_trig, &adis16209_data_rdy_trig_poll);
 
-static DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);
+static IIO_TRIGGER_NAME_ATTR;
 
 static struct attribute *adis16209_trigger_attrs[] = {
        &dev_attr_name.attr,
index 2ba71fd73a47694a1b765e1469157dbcd5058a1a..6cb8681f2853fa0415588d5b404e466e952fff7d 100644 (file)
@@ -30,7 +30,7 @@ static int adis16240_data_rdy_trig_poll(struct iio_dev *dev_info,
 
 IIO_EVENT_SH(data_rdy_trig, &adis16240_data_rdy_trig_poll);
 
-static DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);
+static IIO_TRIGGER_NAME_ATTR;
 
 static struct attribute *adis16240_trigger_attrs[] = {
        &dev_attr_name.attr,
index a68a381836e1f2e793295321b67d684390cfe2e0..f26c0fe441294ebdca2f92731d894a116fa216ce 100644 (file)
@@ -382,7 +382,8 @@ static int lis3l02dq_data_rdy_trigger_set_state(struct iio_trigger *trig,
                                 &t);
        return ret;
 }
-static DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);
+
+static IIO_TRIGGER_NAME_ATTR;
 
 static struct attribute *lis3l02dq_trigger_attrs[] = {
        &dev_attr_name.attr,
index de01537d257eb710f3e0b61eec86228d2b83797e..4a744c11ca6ccf131d6d61375973cc8fb237c175 100644 (file)
@@ -30,7 +30,7 @@ static int adis16260_data_rdy_trig_poll(struct iio_dev *dev_info,
 
 IIO_EVENT_SH(data_rdy_trig, &adis16260_data_rdy_trig_poll);
 
-static DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);
+static IIO_TRIGGER_NAME_ATTR;
 
 static struct attribute *adis16260_trigger_attrs[] = {
        &dev_attr_name.attr,
index 64036cd99102fac1f6b933bf1eb5599d36cd8f89..d6677b64edb9a25800cb1f8d2073a3e47fc50fb8 100644 (file)
@@ -30,7 +30,7 @@ static int adis16300_data_rdy_trig_poll(struct iio_dev *dev_info,
 
 IIO_EVENT_SH(data_rdy_trig, &adis16300_data_rdy_trig_poll);
 
-static DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);
+static IIO_TRIGGER_NAME_ATTR;
 
 static struct attribute *adis16300_trigger_attrs[] = {
        &dev_attr_name.attr,
index 76edccc85b71bac89ceae4d7b381183626fd22d1..739b7ecb2e7c3b501df48effd29e938e1ae358b3 100644 (file)
@@ -30,7 +30,7 @@ static int adis16350_data_rdy_trig_poll(struct iio_dev *dev_info,
 
 IIO_EVENT_SH(data_rdy_trig, &adis16350_data_rdy_trig_poll);
 
-static DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);
+static IIO_TRIGGER_NAME_ATTR;
 
 static struct attribute *adis16350_trigger_attrs[] = {
        &dev_attr_name.attr,
index aafe6010f1b1b3f36489482822212947231b648b..36b5ff5be983d4b09a8791de6259a9083fdeb2d8 100644 (file)
@@ -30,7 +30,7 @@ static int adis16400_data_rdy_trig_poll(struct iio_dev *dev_info,
 
 IIO_EVENT_SH(data_rdy_trig, &adis16400_data_rdy_trig_poll);
 
-static DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);
+static IIO_TRIGGER_NAME_ATTR;
 
 static struct attribute *adis16400_trigger_attrs[] = {
        &dev_attr_name.attr,
index f93cc916983242b38ea409271694b8d53a08a9ef..2ce95e964cfdbbdfe4d4fa9fe37d820f6fe1689b 100644 (file)
@@ -47,7 +47,7 @@ static irqreturn_t iio_gpio_trigger_poll(int irq, void *private)
        return IRQ_HANDLED;
 }
 
-static DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);
+static IIO_TRIGGER_NAME_ATTR;
 
 static struct attribute *iio_gpio_trigger_attrs[] = {
        &dev_attr_name.attr,
index b0b52f84edfd76ee0bdc2a2ebfcd9efc4202ba05..24f174e1cda516546afafc1e326f55c6963b5a45 100644 (file)
@@ -72,17 +72,7 @@ error_ret:
        return ret;
 }
 
-static ssize_t iio_trig_periodic_read_name(struct device *dev,
-                                          struct device_attribute *attr,
-                                          char *buf)
-{
-       struct iio_trigger *trig = dev_get_drvdata(dev);
-       return sprintf(buf, "%s\n", trig->name);
-}
-
-static DEVICE_ATTR(name, S_IRUGO,
-           iio_trig_periodic_read_name,
-           NULL);
+static IIO_TRIGGER_NAME_ATTR;
 static DEVICE_ATTR(frequency, S_IRUGO | S_IWUSR,
            iio_trig_periodic_read_freq,
            iio_trig_periodic_write_freq);