]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpio: mlxbf3: fail probe if gpiochip registration fails
authorPengpeng Hou <pengpeng@iscas.ac.cn>
Mon, 15 Jun 2026 09:19:18 +0000 (17:19 +0800)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Tue, 16 Jun 2026 07:42:17 +0000 (09:42 +0200)
mlxbf3_gpio_probe() logs a devm_gpiochip_add_data() failure but still
returns success. That leaves the platform device bound even though the
GPIO chip was not registered.

Return the registration error so probe failure matches the missing
gpiochip state.

Fixes: cd33f216d241 ("gpio: mlxbf3: Add gpio driver support")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260615091918.43333-1-pengpeng@iscas.ac.cn
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-mlxbf3.c

index 4770578269bae8bdbee60873d77c93d4c4712c9b..566326644a2c12fcb6e9b90171b2fdc0781aa8f2 100644 (file)
@@ -255,7 +255,8 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
 
        ret = devm_gpiochip_add_data(dev, gc, gs);
        if (ret)
-               dev_err_probe(dev, ret, "Failed adding memory mapped gpiochip\n");
+               return dev_err_probe(dev, ret,
+                                    "Failed adding memory mapped gpiochip\n");
 
        return 0;
 }