summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/adc/max1363_core.c
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-08-12 16:55:29 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-23 13:28:42 -0700
commitcd0380190f7c7ad8d5a8f15403a67fedd37fcddb (patch)
treea1f0e28698fab9c5e070b72b518e9f2017bbe3a9 /drivers/staging/iio/adc/max1363_core.c
parentcdf6e817904412931ba9a54fa0376cf6f4f678fe (diff)
staging:iio:adc: max1363 fix 2 raw sysfs issues.
indio_dev->channels was accidentally removed thus preventing any sysfs registrations occuring for direct reading. That hid the other issue. Unfortunately the incorrect handling leads to misspresentation of data in sysfs reads. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/adc/max1363_core.c')
-rw-r--r--drivers/staging/iio/adc/max1363_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
index 72b0917412ee..d93b7a917b99 100644
--- a/drivers/staging/iio/adc/max1363_core.c
+++ b/drivers/staging/iio/adc/max1363_core.c
@@ -255,7 +255,7 @@ static int max1363_read_raw(struct iio_dev *indio_dev,
switch (m) {
case 0:
ret = max1363_read_single_chan(indio_dev, chan, val, m);
- if (ret)
+ if (ret < 0)
return ret;
return IIO_VAL_INT;
case (1 << IIO_CHAN_INFO_SCALE_SHARED):
@@ -1295,6 +1295,8 @@ static int __devinit max1363_probe(struct i2c_client *client,
indio_dev->info = st->chip_info->info;
indio_dev->modes = INDIO_DIRECT_MODE;
+ indio_dev->channels = st->chip_info->channels;
+ indio_dev->num_channels = st->chip_info->num_channels;
ret = max1363_initial_setup(st);
if (ret < 0)
goto error_free_available_scan_masks;