Skip to content
Commit 7e982555 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jonathan Cameron
Browse files

staging: iio: fix ad7606_spi regression



As pointed out by Geert Uytterhoeven, the patch was incorrect
and breaks the driver, which was fortunately pointed out by
this gcc warning:

drivers/staging/iio/adc/ad7606_spi.c: In function ‘ad7606_spi_read_block’:
drivers/staging/iio/adc/ad7606_spi.c:34: warning: ‘data’ is used uninitialized in this function

The effect of the patch is that the data is copied into
a random memory location (from the uninitialized pointer)
instead of being byteswapped in place.

This adds the initialization for the 'data' variable back
to restore the original behavior.

Cc: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Fixes: 87787e5e ("Staging: iio: Fix sparse endian warning")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 6e85dbe4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment