staging: iio: tsl2x7x: move calibscale_available attribute to IIO_INTENSITY channel
authorBrian Masney <masneyb@onstation.org>
Fri, 4 May 2018 02:53:12 +0000 (22:53 -0400)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 6 May 2018 18:05:37 +0000 (19:05 +0100)
The calibscale_available attribute is currently associated with the
IIO_LIGHT channel but should be associated with the IIO_INTENSITY
channel. This patch corrects that association and it also corrects
lines that were unnecessarily split for the
in_intensity0_integration_time sysfs attribute.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/light/tsl2x7x.c

index 7e8db5178a2cbd43c6cbaead9069826d1be23d2e..9aee04fb41688dd8886cc9e61c3745e24b2ed91b 100644 (file)
@@ -777,9 +777,9 @@ static int tsl2x7x_prox_cal(struct iio_dev *indio_dev)
 }
 
 static ssize_t
-in_illuminance0_calibscale_available_show(struct device *dev,
-                                         struct device_attribute *attr,
-                                         char *buf)
+in_intensity0_calibscale_available_show(struct device *dev,
+                                       struct device_attribute *attr,
+                                       char *buf)
 {
        struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
 
@@ -1247,7 +1247,7 @@ static int tsl2x7x_write_raw(struct iio_dev *indio_dev,
        return tsl2x7x_invoke_change(indio_dev);
 }
 
-static DEVICE_ATTR_RO(in_illuminance0_calibscale_available);
+static DEVICE_ATTR_RO(in_intensity0_calibscale_available);
 
 static DEVICE_ATTR_RW(in_illuminance0_target_input);
 
@@ -1321,9 +1321,8 @@ static irqreturn_t tsl2x7x_event_handler(int irq, void *private)
 }
 
 static struct attribute *tsl2x7x_ALS_device_attrs[] = {
-       &dev_attr_in_illuminance0_calibscale_available.attr,
-       &iio_const_attr_in_intensity0_integration_time_available
-               .dev_attr.attr,
+       &dev_attr_in_intensity0_calibscale_available.attr,
+       &iio_const_attr_in_intensity0_integration_time_available.dev_attr.attr,
        &dev_attr_in_illuminance0_target_input.attr,
        &dev_attr_in_illuminance0_calibrate.attr,
        &dev_attr_in_illuminance0_lux_table.attr,
@@ -1336,9 +1335,8 @@ static struct attribute *tsl2x7x_PRX_device_attrs[] = {
 };
 
 static struct attribute *tsl2x7x_ALSPRX_device_attrs[] = {
-       &dev_attr_in_illuminance0_calibscale_available.attr,
-       &iio_const_attr_in_intensity0_integration_time_available
-               .dev_attr.attr,
+       &dev_attr_in_intensity0_calibscale_available.attr,
+       &iio_const_attr_in_intensity0_integration_time_available.dev_attr.attr,
        &dev_attr_in_illuminance0_target_input.attr,
        &dev_attr_in_illuminance0_calibrate.attr,
        &dev_attr_in_illuminance0_lux_table.attr,
@@ -1352,9 +1350,8 @@ static struct attribute *tsl2x7x_PRX2_device_attrs[] = {
 };
 
 static struct attribute *tsl2x7x_ALSPRX2_device_attrs[] = {
-       &dev_attr_in_illuminance0_calibscale_available.attr,
-       &iio_const_attr_in_intensity0_integration_time_available
-               .dev_attr.attr,
+       &dev_attr_in_intensity0_calibscale_available.attr,
+       &iio_const_attr_in_intensity0_integration_time_available.dev_attr.attr,
        &dev_attr_in_illuminance0_target_input.attr,
        &dev_attr_in_illuminance0_calibrate.attr,
        &dev_attr_in_illuminance0_lux_table.attr,