From 9e7d479d406e1bfb3e56dd4a14f6db8b6ee024b1 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sat, 30 Oct 2021 19:58:05 +0200 Subject: 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 Link: https://lore.barebox.org/20211030175812.2276705-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- arch/arm/boards/guf-santaro/board.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/arm') 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) -- cgit v1.2.3