diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-07 11:57:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-07 11:57:00 -0500 |
commit | 81e990bbdeb77db80d7e7f0e36e159a0facfdff0 (patch) | |
tree | 0ec51a2bcf825c35d524af027237b17cff89a8f3 /drivers/iio/light | |
parent | 5a819ed6d4bb803ee609b4ceedd7c8efbbfa65e0 (diff) | |
parent | 8c314da583c9d5c67fe59aa8c92f94f15cb8de90 (diff) |
Merge tag 'iio-fixes-for-3.14a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes:
First set of IIO fixes for the 3.14 cycle.
Included is the patch previously set as the fourth round for 3.13 which was
to late to be appropriate.
* Another endian fix (ad799x adc) due to missuse of the IIO_ST macro (which
is going away very shortly)
* A reversed error check in ad5933 which will make the probe fail.
* A buffer overflow in the example code in the documentation.
* ad799x was freeing an irq that might or might not have been requested.
* tsl2563 was checking the wrong element of chan_spec for modifiers. Thus some
sysfs reads would give the wrong values.
* A missing dependency on HAS_IOMEM in spear_adc and lpc32xx was causing some
test build failures (on s390 and perhaps elsewhere).
I also have a few fixes queued up for things that went in during the 3.14
merge window which will follow as a separate pull request (to avoid rebasing
my tree).
Diffstat (limited to 'drivers/iio/light')
-rw-r--r-- | drivers/iio/light/tsl2563.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c index 3d8110157f2d..94daa9fc1247 100644 --- a/drivers/iio/light/tsl2563.c +++ b/drivers/iio/light/tsl2563.c | |||
@@ -460,10 +460,14 @@ static int tsl2563_write_raw(struct iio_dev *indio_dev, | |||
460 | { | 460 | { |
461 | struct tsl2563_chip *chip = iio_priv(indio_dev); | 461 | struct tsl2563_chip *chip = iio_priv(indio_dev); |
462 | 462 | ||
463 | if (chan->channel == IIO_MOD_LIGHT_BOTH) | 463 | if (mask != IIO_CHAN_INFO_CALIBSCALE) |
464 | return -EINVAL; | ||
465 | if (chan->channel2 == IIO_MOD_LIGHT_BOTH) | ||
464 | chip->calib0 = calib_from_sysfs(val); | 466 | chip->calib0 = calib_from_sysfs(val); |
465 | else | 467 | else if (chan->channel2 == IIO_MOD_LIGHT_IR) |
466 | chip->calib1 = calib_from_sysfs(val); | 468 | chip->calib1 = calib_from_sysfs(val); |
469 | else | ||
470 | return -EINVAL; | ||
467 | 471 | ||
468 | return 0; | 472 | return 0; |
469 | } | 473 | } |
@@ -472,14 +476,14 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev, | |||
472 | struct iio_chan_spec const *chan, | 476 | struct iio_chan_spec const *chan, |
473 | int *val, | 477 | int *val, |
474 | int *val2, | 478 | int *val2, |
475 | long m) | 479 | long mask) |
476 | { | 480 | { |
477 | int ret = -EINVAL; | 481 | int ret = -EINVAL; |
478 | u32 calib0, calib1; | 482 | u32 calib0, calib1; |
479 | struct tsl2563_chip *chip = iio_priv(indio_dev); | 483 | struct tsl2563_chip *chip = iio_priv(indio_dev); |
480 | 484 | ||
481 | mutex_lock(&chip->lock); | 485 | mutex_lock(&chip->lock); |
482 | switch (m) { | 486 | switch (mask) { |
483 | case IIO_CHAN_INFO_RAW: | 487 | case IIO_CHAN_INFO_RAW: |
484 | case IIO_CHAN_INFO_PROCESSED: | 488 | case IIO_CHAN_INFO_PROCESSED: |
485 | switch (chan->type) { | 489 | switch (chan->type) { |
@@ -498,7 +502,7 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev, | |||
498 | ret = tsl2563_get_adc(chip); | 502 | ret = tsl2563_get_adc(chip); |
499 | if (ret) | 503 | if (ret) |
500 | goto error_ret; | 504 | goto error_ret; |
501 | if (chan->channel == 0) | 505 | if (chan->channel2 == IIO_MOD_LIGHT_BOTH) |
502 | *val = chip->data0; | 506 | *val = chip->data0; |
503 | else | 507 | else |
504 | *val = chip->data1; | 508 | *val = chip->data1; |
@@ -510,7 +514,7 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev, | |||
510 | break; | 514 | break; |
511 | 515 | ||
512 | case IIO_CHAN_INFO_CALIBSCALE: | 516 | case IIO_CHAN_INFO_CALIBSCALE: |
513 | if (chan->channel == 0) | 517 | if (chan->channel2 == IIO_MOD_LIGHT_BOTH) |
514 | *val = calib_to_sysfs(chip->calib0); | 518 | *val = calib_to_sysfs(chip->calib0); |
515 | else | 519 | else |
516 | *val = calib_to_sysfs(chip->calib1); | 520 | *val = calib_to_sysfs(chip->calib1); |