[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e93ea83e-aa94-885b-4686-2e2873ef1efa@metafoo.de>
Date: Thu, 14 Sep 2017 15:57:34 +0200
From: Lars-Peter Clausen <lars@...afoo.de>
To: Stefan Popa <stefan.popa@...log.com>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Jonathan Cameron <jic23@...nel.org>
Cc: Hartmut Knaack <knaack.h@....de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-iio@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: iio: ad7192: Use the dedicated reset function
On 09/14/2017 03:50 PM, Stefan Popa wrote:
> SPI host drivers can use DMA to transfer data, so the buffer should be properly allocated.
> Keeping it on the stack could cause an undefined behavior.
>
> The dedicated reset function solves this issue.
>
> Signed-off-by: Stefan Popa <stefan.popa@...log.com>
Acked-by: Lars-Peter Clausen <lars@...afoo.de>
Thanks.
> ---
> drivers/staging/iio/adc/ad7192.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
> index d11c6de..6150d27 100644
> --- a/drivers/staging/iio/adc/ad7192.c
> +++ b/drivers/staging/iio/adc/ad7192.c
> @@ -223,11 +223,9 @@ static int ad7192_setup(struct ad7192_state *st,
> struct iio_dev *indio_dev = spi_get_drvdata(st->sd.spi);
> unsigned long long scale_uv;
> int i, ret, id;
> - u8 ones[6];
>
> /* reset the serial interface */
> - memset(&ones, 0xFF, 6);
> - ret = spi_write(st->sd.spi, &ones, 6);
> + ret = ad_sd_reset(&st->sd, 48);
> if (ret < 0)
> goto out;
> usleep_range(500, 1000); /* Wait for at least 500us */
>
Powered by blists - more mailing lists