Skip to content

Commit

Permalink
staging:iio:adc:ad7606 add channel type specification to range attrib…
Browse files Browse the repository at this point in the history
…utes.

Cleaner and more consistent naming + makes one abi element we don't need
go away.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Sep 16, 2011
1 parent 322c956 commit cedd1a1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/staging/iio/adc/ad7606_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ static ssize_t ad7606_store_range(struct device *dev,
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);
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,
struct device_attribute *attr, char *buf)
Expand Down Expand Up @@ -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 struct attribute *ad7606_attributes[] = {
&iio_dev_attr_range.dev_attr.attr,
&iio_const_attr_range_available.dev_attr.attr,
&iio_dev_attr_in_voltage_range.dev_attr.attr,
&iio_const_attr_in_voltage_range_available.dev_attr.attr,
&iio_dev_attr_oversampling_ratio.dev_attr.attr,
&iio_const_attr_oversampling_ratio_available.dev_attr.attr,
NULL,
Expand All @@ -220,9 +220,10 @@ static mode_t ad7606_attr_is_visible(struct kobject *kobj,
&iio_const_attr_oversampling_ratio_available.dev_attr.attr))
mode = 0;
else if (!st->have_range &&
(attr == &iio_dev_attr_range.dev_attr.attr ||
attr == &iio_const_attr_range_available.dev_attr.attr))
mode = 0;
(attr == &iio_dev_attr_in_voltage_range.dev_attr.attr ||
attr ==
&iio_const_attr_in_voltage_range_available.dev_attr.attr))
mode = 0;

return mode;
}
Expand Down

0 comments on commit cedd1a1

Please sign in to comment.