From: Algapally Santosh Sagar Date: Fri, 20 Jan 2023 05:36:15 +0000 (-0700) Subject: gpio: zynqmp: Handle error from get_gpio_modepin X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=508e1aa58c8f02a6b1a1013e3ff79d3e76015104;p=u-boot.git gpio: zynqmp: Handle error from get_gpio_modepin There is a unused variable ret, due to which we are getting sparse warning as below. warning: variable 'ret' set but not used [-Wunused-but-set-variable]. Return ret incase of error. Signed-off-by: Algapally Santosh Sagar Signed-off-by: Ashok Reddy Soma Link: https://lore.kernel.org/r/20230120053617.32463-3-ashok.reddy.soma@amd.com Signed-off-by: Michal Simek --- diff --git a/drivers/gpio/zynqmp_gpio_modepin.c b/drivers/gpio/zynqmp_gpio_modepin.c index 078fd83395..e9565ff543 100644 --- a/drivers/gpio/zynqmp_gpio_modepin.c +++ b/drivers/gpio/zynqmp_gpio_modepin.c @@ -48,6 +48,9 @@ static int modepin_gpio_set_value(struct udevice *dev, unsigned int offset, int ret; ret = get_gpio_modepin(ret_payload); + if (ret) + return ret; + if (value) out_val = OUTVAL(offset) | ret_payload[1]; else