pinctrl: nsp-gpio: Silence probe deferral messages
authorFlorian Fainelli <florian.fainelli@broadcom.com>
Tue, 8 Aug 2023 18:07:33 +0000 (11:07 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 10 Aug 2023 08:41:20 +0000 (10:41 +0200)
We can have gpiochip_add_data() return -EPROBE_DEFER which will make
us produce the "unable to add GPIO chip" message which is confusing.
Use dev_err_probe() to silence probe deferral messages.

Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Link: https://lore.kernel.org/r/20230808180733.2081353-3-florian.fainelli@broadcom.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/bcm/pinctrl-nsp-gpio.c

index e8a5ecd..84af6aa 100644 (file)
@@ -685,10 +685,8 @@ static int nsp_gpio_probe(struct platform_device *pdev)
        }
 
        ret = devm_gpiochip_add_data(dev, gc, chip);
-       if (ret < 0) {
-               dev_err(dev, "unable to add GPIO chip\n");
-               return ret;
-       }
+       if (ret < 0)
+               return dev_err_probe(dev, ret, "unable to add GPIO chip\n");
 
        ret = nsp_gpio_register_pinconf(chip);
        if (ret) {