lkml.org 
[lkml]   [2022]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 08/16] iio: adc: at91-sama5d2_adc: move oversampling storage in its function
    Date
    Move the storage of oversampling_ratio in at91_adc_config_emr().
    This prepares for the next commits.

    Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
    ---
    drivers/iio/adc/at91-sama5d2_adc.c | 5 ++---
    1 file changed, 2 insertions(+), 3 deletions(-)

    diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
    index fbb98e216e70..76367cc948e8 100644
    --- a/drivers/iio/adc/at91-sama5d2_adc.c
    +++ b/drivers/iio/adc/at91-sama5d2_adc.c
    @@ -796,6 +796,8 @@ static int at91_adc_config_emr(struct at91_adc_state *st,

    at91_adc_writel(st, EMR, emr);

    + st->oversampling_ratio = oversampling_ratio;
    +
    return 0;
    }

    @@ -1695,9 +1697,6 @@ static int at91_adc_write_raw(struct iio_dev *indio_dev,
    goto unlock;
    /* update ratio */
    ret = at91_adc_config_emr(st, val);
    - if (ret)
    - goto unlock;
    - st->oversampling_ratio = val;
    unlock:
    mutex_unlock(&st->lock);
    return ret;
    --
    2.34.1
    \
     
     \ /
      Last update: 2022-06-09 10:32    [W:3.736 / U:0.568 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site