diff options
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/iio/accel/lis3l02dq_core.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/adc/ad7291.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/adc/mxs-lradc.c | 18 |
3 files changed, 10 insertions, 11 deletions
diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c index 1bfe5d81792b..8ed75a94f465 100644 --- a/drivers/staging/iio/accel/lis3l02dq_core.c +++ b/drivers/staging/iio/accel/lis3l02dq_core.c | |||
@@ -257,6 +257,8 @@ static int lis3l02dq_read_raw(struct iio_dev *indio_dev, | |||
257 | ret = lis3l02dq_read_reg_s16(indio_dev, reg, val); | 257 | ret = lis3l02dq_read_reg_s16(indio_dev, reg, val); |
258 | } | 258 | } |
259 | mutex_unlock(&indio_dev->mlock); | 259 | mutex_unlock(&indio_dev->mlock); |
260 | if (ret < 0) | ||
261 | goto error_ret; | ||
260 | return IIO_VAL_INT; | 262 | return IIO_VAL_INT; |
261 | case IIO_CHAN_INFO_SCALE: | 263 | case IIO_CHAN_INFO_SCALE: |
262 | *val = 0; | 264 | *val = 0; |
diff --git a/drivers/staging/iio/adc/ad7291.c b/drivers/staging/iio/adc/ad7291.c index 3fc79e582750..a2e61c2fc8d1 100644 --- a/drivers/staging/iio/adc/ad7291.c +++ b/drivers/staging/iio/adc/ad7291.c | |||
@@ -517,6 +517,7 @@ static const struct iio_info ad7291_info = { | |||
517 | .read_event_value = &ad7291_read_event_value, | 517 | .read_event_value = &ad7291_read_event_value, |
518 | .write_event_value = &ad7291_write_event_value, | 518 | .write_event_value = &ad7291_write_event_value, |
519 | .event_attrs = &ad7291_event_attribute_group, | 519 | .event_attrs = &ad7291_event_attribute_group, |
520 | .driver_module = THIS_MODULE, | ||
520 | }; | 521 | }; |
521 | 522 | ||
522 | static int ad7291_probe(struct i2c_client *client, | 523 | static int ad7291_probe(struct i2c_client *client, |
diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index d92c97a59d61..9f52a2857929 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/staging/iio/adc/mxs-lradc.c | |||
@@ -234,7 +234,6 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev, | |||
234 | { | 234 | { |
235 | struct mxs_lradc *lradc = iio_priv(iio_dev); | 235 | struct mxs_lradc *lradc = iio_priv(iio_dev); |
236 | int ret; | 236 | int ret; |
237 | unsigned long mask; | ||
238 | 237 | ||
239 | if (m != IIO_CHAN_INFO_RAW) | 238 | if (m != IIO_CHAN_INFO_RAW) |
240 | return -EINVAL; | 239 | return -EINVAL; |
@@ -243,12 +242,6 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev, | |||
243 | if (chan->channel > LRADC_MAX_TOTAL_CHANS) | 242 | if (chan->channel > LRADC_MAX_TOTAL_CHANS) |
244 | return -EINVAL; | 243 | return -EINVAL; |
245 | 244 | ||
246 | /* Validate the channel if it doesn't intersect with reserved chans. */ | ||
247 | bitmap_set(&mask, chan->channel, 1); | ||
248 | ret = iio_validate_scan_mask_onehot(iio_dev, &mask); | ||
249 | if (ret) | ||
250 | return -EINVAL; | ||
251 | |||
252 | /* | 245 | /* |
253 | * See if there is no buffered operation in progess. If there is, simply | 246 | * See if there is no buffered operation in progess. If there is, simply |
254 | * bail out. This can be improved to support both buffered and raw IO at | 247 | * bail out. This can be improved to support both buffered and raw IO at |
@@ -661,12 +654,13 @@ static int mxs_lradc_trigger_init(struct iio_dev *iio) | |||
661 | { | 654 | { |
662 | int ret; | 655 | int ret; |
663 | struct iio_trigger *trig; | 656 | struct iio_trigger *trig; |
657 | struct mxs_lradc *lradc = iio_priv(iio); | ||
664 | 658 | ||
665 | trig = iio_trigger_alloc("%s-dev%i", iio->name, iio->id); | 659 | trig = iio_trigger_alloc("%s-dev%i", iio->name, iio->id); |
666 | if (trig == NULL) | 660 | if (trig == NULL) |
667 | return -ENOMEM; | 661 | return -ENOMEM; |
668 | 662 | ||
669 | trig->dev.parent = iio->dev.parent; | 663 | trig->dev.parent = lradc->dev; |
670 | iio_trigger_set_drvdata(trig, iio); | 664 | iio_trigger_set_drvdata(trig, iio); |
671 | trig->ops = &mxs_lradc_trigger_ops; | 665 | trig->ops = &mxs_lradc_trigger_ops; |
672 | 666 | ||
@@ -676,15 +670,17 @@ static int mxs_lradc_trigger_init(struct iio_dev *iio) | |||
676 | return ret; | 670 | return ret; |
677 | } | 671 | } |
678 | 672 | ||
679 | iio->trig = trig; | 673 | lradc->trig = trig; |
680 | 674 | ||
681 | return 0; | 675 | return 0; |
682 | } | 676 | } |
683 | 677 | ||
684 | static void mxs_lradc_trigger_remove(struct iio_dev *iio) | 678 | static void mxs_lradc_trigger_remove(struct iio_dev *iio) |
685 | { | 679 | { |
686 | iio_trigger_unregister(iio->trig); | 680 | struct mxs_lradc *lradc = iio_priv(iio); |
687 | iio_trigger_free(iio->trig); | 681 | |
682 | iio_trigger_unregister(lradc->trig); | ||
683 | iio_trigger_free(lradc->trig); | ||
688 | } | 684 | } |
689 | 685 | ||
690 | static int mxs_lradc_buffer_preenable(struct iio_dev *iio) | 686 | static int mxs_lradc_buffer_preenable(struct iio_dev *iio) |