staging: iio: trigger: blackfin timer: replace device_attr with device_attr_rw
authorAishwarya Pant <aishpant@gmail.com>
Thu, 4 Jan 2018 10:58:51 +0000 (16:28 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jan 2018 15:03:43 +0000 (16:03 +0100)
This is a clean-up patch which replaces DEVICE_ATTR() macro with the
file permission specific DEVICE_ATTR_RW() macro for compaction and
readability. Done using coccinelle.

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/trigger/iio-trig-bfin-timer.c

index f389f5cca99d6151d635f50794ba1472237b0aac..71f11d7472c0824176e1cdb5c0f473097bef73f2 100644 (file)
@@ -78,9 +78,9 @@ static int iio_bfin_tmr_set_state(struct iio_trigger *trig, bool state)
        return 0;
 }
 
-static ssize_t iio_bfin_tmr_frequency_store(struct device *dev,
-                                           struct device_attribute *attr,
-                                           const char *buf, size_t count)
+static ssize_t frequency_store(struct device *dev,
+                              struct device_attribute *attr,
+                              const char *buf, size_t count)
 {
        struct iio_trigger *trig = to_iio_trigger(dev);
        struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig);
@@ -116,9 +116,9 @@ static ssize_t iio_bfin_tmr_frequency_store(struct device *dev,
        return count;
 }
 
-static ssize_t iio_bfin_tmr_frequency_show(struct device *dev,
-                                          struct device_attribute *attr,
-                                          char *buf)
+static ssize_t frequency_show(struct device *dev,
+                             struct device_attribute *attr,
+                             char *buf)
 {
        struct iio_trigger *trig = to_iio_trigger(dev);
        struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig);
@@ -133,8 +133,7 @@ static ssize_t iio_bfin_tmr_frequency_show(struct device *dev,
        return sprintf(buf, "%lu\n", val);
 }
 
-static DEVICE_ATTR(frequency, 0644, iio_bfin_tmr_frequency_show,
-                  iio_bfin_tmr_frequency_store);
+static DEVICE_ATTR_RW(frequency);
 
 static struct attribute *iio_bfin_tmr_trigger_attrs[] = {
        &dev_attr_frequency.attr,