[SRU][J:linux-bluefield][PATCH v1 2/3] gpio: mlxbf3: add an error code check in mlxbf3_gpio_probe

David Thompson davthompson at nvidia.com
Fri May 2 19:22:27 UTC 2025


From: Su Hui <suhui at nfschina.com>

BugLink: https://bugs.launchpad.net/bugs/2109756

Clang static checker warning: Value stored to 'ret' is never read.
bgpio_init() returns error code if failed, it's better to add this
check.

Fixes: cd33f216d241 ("gpio: mlxbf3: Add gpio driver support")
Signed-off-by: Su Hui <suhui at nfschina.com>
[Bartosz: add the Fixes: tag]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski at linaro.org>
(cherry picked from commit d460e9c2075164e9b1fa9c4c95f8c05517bd8752)
Signed-off-by: David Thompson <davthompson at nvidia.com>
Reviewed-by: Asmaa Mnebhi <asmaa at nvidia.com>
---
 drivers/gpio/gpio-mlxbf3.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-mlxbf3.c b/drivers/gpio/gpio-mlxbf3.c
index 9d1bd3f6e23f..8bc56fc9f725 100644
--- a/drivers/gpio/gpio-mlxbf3.c
+++ b/drivers/gpio/gpio-mlxbf3.c
@@ -230,6 +230,8 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
 			gs->gpio_clr_io + MLXBF_GPIO_FW_DATA_OUT_CLEAR,
 			gs->gpio_set_io + MLXBF_GPIO_FW_OUTPUT_ENABLE_SET,
 			gs->gpio_clr_io + MLXBF_GPIO_FW_OUTPUT_ENABLE_CLEAR, 0);
+	if (ret)
+		return dev_err_probe(dev, ret, "%s: bgpio_init() failed", __func__);
 
 	gc->request = gpiochip_generic_request;
 	gc->free = gpiochip_generic_free;
-- 
2.43.2




More information about the kernel-team mailing list