staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR
authorRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Wed, 7 Mar 2018 00:43:47 +0000 (21:43 -0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 7 Mar 2018 20:07:07 +0000 (20:07 +0000)
The macro IIO_DEV_ATTR_CH_OFF is a wrapper for IIO_DEVICE_ATTR, with a
tiny change in the name definition. This extra macro does not improve
the readability and also creates some checkpatch errors.

This patch fixes the checkpatch.pl errors:

staging/iio/meter/ade7753.c:391: ERROR: Use 4 digit octal (0777) not
decimal permissions
staging/iio/meter/ade7753.c:395: ERROR: Use 4 digit octal (0777) not
decimal permissions
staging/iio/meter/ade7759.c:331: ERROR: Use 4 digit octal (0777) not
decimal permissions
staging/iio/meter/ade7759.c:335: ERROR: Use 4 digit octal (0777) not
decimal permissions

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/meter/ade7753.c
drivers/staging/iio/meter/ade7759.c

index c44eb577dc354d0a0f305f46b06b5b399370f632..275e8dfff83603cd36ef3a9c765030792809e5b6 100644 (file)
@@ -388,14 +388,16 @@ static IIO_DEV_ATTR_VPERIOD(0444,
                ade7753_read_16bit,
                NULL,
                ADE7753_PERIOD);
-static IIO_DEV_ATTR_CH_OFF(1, 0644,
-               ade7753_read_8bit,
-               ade7753_write_8bit,
-               ADE7753_CH1OS);
-static IIO_DEV_ATTR_CH_OFF(2, 0644,
-               ade7753_read_8bit,
-               ade7753_write_8bit,
-               ADE7753_CH2OS);
+
+static IIO_DEVICE_ATTR(choff_1, 0644,
+                       ade7753_read_8bit,
+                       ade7753_write_8bit,
+                       ADE7753_CH1OS);
+
+static IIO_DEVICE_ATTR(choff_2, 0644,
+                       ade7753_read_8bit,
+                       ade7753_write_8bit,
+                       ADE7753_CH2OS);
 
 static int ade7753_set_irq(struct device *dev, bool enable)
 {
index 1decb2b8afab1414d561ab55c55580789f8a96c7..c078b770fa53e943abe30bcb5a5d9551a5da16e9 100644 (file)
@@ -328,14 +328,16 @@ static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(0644,
                ade7759_read_16bit,
                ade7759_write_16bit,
                ADE7759_APGAIN);
-static IIO_DEV_ATTR_CH_OFF(1, 0644,
-               ade7759_read_8bit,
-               ade7759_write_8bit,
-               ADE7759_CH1OS);
-static IIO_DEV_ATTR_CH_OFF(2, 0644,
-               ade7759_read_8bit,
-               ade7759_write_8bit,
-               ADE7759_CH2OS);
+
+static IIO_DEVICE_ATTR(choff_1, 0644,
+                       ade7759_read_8bit,
+                       ade7759_write_8bit,
+                       ADE7759_CH1OS);
+
+static IIO_DEVICE_ATTR(choff_2, 0644,
+                       ade7759_read_8bit,
+                       ade7759_write_8bit,
+                       ADE7759_CH2OS);
 
 static int ade7759_set_irq(struct device *dev, bool enable)
 {