diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-10-30 19:58:05 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-11-01 11:32:16 +0100 |
commit | 9e7d479d406e1bfb3e56dd4a14f6db8b6ee024b1 (patch) | |
tree | 5866bc14a1fe1c4ffb7f2b790288235fdc784568 /arch/arm | |
parent | bdf430340367e7b0d1a0bbfd749dc63821851d7f (diff) | |
download | barebox-9e7d479d406e1bfb3e56dd4a14f6db8b6ee024b1.tar.gz barebox-9e7d479d406e1bfb3e56dd4a14f6db8b6ee024b1.tar.xz |
ARM: i.MX: guf-santaro: fix passing around of uninitialized variable
i2c_device_present() does a zero byte read to probe for the i2c
device. Make i2c_write_reg handle a NULL buf to silence the compiler
warning.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211030175812.2276705-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/boards/guf-santaro/board.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/arm/boards/guf-santaro/board.c b/arch/arm/boards/guf-santaro/board.c index 34005ff7bf..cfc85af59e 100644 --- a/arch/arm/boards/guf-santaro/board.c +++ b/arch/arm/boards/guf-santaro/board.c @@ -22,12 +22,11 @@ static int i2c_device_present(struct i2c_adapter *adapter, int addr) { struct i2c_client client = {}; - u8 reg; client.adapter = adapter; client.addr = addr; - return i2c_write_reg(&client, 0x00, ®, 0) < 0 ? false : true; + return i2c_write_reg(&client, 0x00, NULL, 0) < 0 ? false : true; } #define TOUCH_RESET_GPIO IMX_GPIO_NR(1, 20) |