lkml.org 
[lkml]   [2019]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 042/177] iio: adc: ad7606: fix reading unnecessary data from device
    Date
    From: Beniamin Bia <beniamin.bia@analog.com>

    commit 341826a065660d1b77d89e6335b6095cd654271c upstream.

    When a conversion result is being read from ADC, the driver reads the
    number of channels + 1 because it thinks that IIO_CHAN_SOFT_TIMESTAMP
    is also a physical channel. This patch fixes this issue.

    Fixes: 2985a5d88455 ("staging: iio: adc: ad7606: Move out of staging")
    Reported-by: Robert Wörle <rwoerle@mibtec.de>
    Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/iio/adc/ad7606.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/iio/adc/ad7606.c
    +++ b/drivers/iio/adc/ad7606.c
    @@ -85,7 +85,7 @@ err_unlock:

    static int ad7606_read_samples(struct ad7606_state *st)
    {
    - unsigned int num = st->chip_info->num_channels;
    + unsigned int num = st->chip_info->num_channels - 1;
    u16 *data = st->data;
    int ret;


    \
     
     \ /
      Last update: 2019-12-16 19:17    [W:4.029 / U:1.628 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site