Commit cedd1a16 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

staging:iio:adc:ad7606 add channel type specification to range attributes.

Cleaner and more consistent naming + makes one abi element we don't need
go away.
Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 322c9563
...@@ -140,9 +140,9 @@ static ssize_t ad7606_store_range(struct device *dev, ...@@ -140,9 +140,9 @@ static ssize_t ad7606_store_range(struct device *dev,
return count; return count;
} }
static IIO_DEVICE_ATTR(range, S_IRUGO | S_IWUSR, \ static IIO_DEVICE_ATTR(in_voltage_range, S_IRUGO | S_IWUSR, \
ad7606_show_range, ad7606_store_range, 0); ad7606_show_range, ad7606_store_range, 0);
static IIO_CONST_ATTR(range_available, "5000 10000"); static IIO_CONST_ATTR(in_voltage_range_available, "5000 10000");
static ssize_t ad7606_show_oversampling_ratio(struct device *dev, static ssize_t ad7606_show_oversampling_ratio(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
...@@ -198,8 +198,8 @@ static IIO_DEVICE_ATTR(oversampling_ratio, S_IRUGO | S_IWUSR, ...@@ -198,8 +198,8 @@ static IIO_DEVICE_ATTR(oversampling_ratio, S_IRUGO | S_IWUSR,
static IIO_CONST_ATTR(oversampling_ratio_available, "0 2 4 8 16 32 64"); static IIO_CONST_ATTR(oversampling_ratio_available, "0 2 4 8 16 32 64");
static struct attribute *ad7606_attributes[] = { static struct attribute *ad7606_attributes[] = {
&iio_dev_attr_range.dev_attr.attr, &iio_dev_attr_in_voltage_range.dev_attr.attr,
&iio_const_attr_range_available.dev_attr.attr, &iio_const_attr_in_voltage_range_available.dev_attr.attr,
&iio_dev_attr_oversampling_ratio.dev_attr.attr, &iio_dev_attr_oversampling_ratio.dev_attr.attr,
&iio_const_attr_oversampling_ratio_available.dev_attr.attr, &iio_const_attr_oversampling_ratio_available.dev_attr.attr,
NULL, NULL,
...@@ -220,9 +220,10 @@ static mode_t ad7606_attr_is_visible(struct kobject *kobj, ...@@ -220,9 +220,10 @@ static mode_t ad7606_attr_is_visible(struct kobject *kobj,
&iio_const_attr_oversampling_ratio_available.dev_attr.attr)) &iio_const_attr_oversampling_ratio_available.dev_attr.attr))
mode = 0; mode = 0;
else if (!st->have_range && else if (!st->have_range &&
(attr == &iio_dev_attr_range.dev_attr.attr || (attr == &iio_dev_attr_in_voltage_range.dev_attr.attr ||
attr == &iio_const_attr_range_available.dev_attr.attr)) attr ==
mode = 0; &iio_const_attr_in_voltage_range_available.dev_attr.attr))
mode = 0;
return mode; return mode;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment