Skip to contentSkip to conversation

gpio: omap: handle deferred probe with dev_err_probe() for gpiochip_add_data()

PATCH In review Grygorii Strashko 3 participants 4 messages Nov 18, 2020 – Nov 30, 2020

Subsystems (2)
lore
Share & tools
lore

Grygorii Strashko

author maintainer
#0 lore raw

PATCH 1/1 gpio: omap: handle deferred probe with dev_err_probe() for gpiochip_add_data()

The gpiochip_add_data() may return -EPROBE_DEFER which is not handled properly by TI GPIO driver and causes unnecessary boot log messages.

Hence, add proper deferred probe handling with new dev_err_probe() API.

---
 drivers/gpio/gpio-omap.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpio/gpio-omap.c +2 -5
index f7ceb2b11afc..41952bb818ad 100644
@@ -1049,11 +1049,8 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
 	irq->first = irq_base;
 
 	ret = gpiochip_add_data(&bank->chip, bank);
-	if (ret) {
-		dev_err(bank->chip.parent,
-			"Could not register gpio chip %d\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(bank->chip.parent, ret, "Could not register gpio chip\n");
 
 	ret = devm_request_irq(bank->chip.parent, bank->irq,
 			       omap_gpio_irq_handler,
Signature · 1 line
2.17.1
author maintainer
#2 lore raw

Hi All,

Quoted 10 lines · Tony Lindgren
Quoted 6 lines · Grygorii Strashko

The gpiochip_add_data() may return -EPROBE_DEFER which is not handled properly by TI GPIO driver and causes unnecessary boot log messages.

Hence, add proper deferred probe handling with new dev_err_probe() API.

Are there any comments? Could it be merged?
On am335 we no do see ~10 annoying error messages during boot as there now is dependency from pinctrl on this platform.

Signature · 2 lines
Best regards,
grygorii
#3 lore raw
In reply to Grygorii Strashko
Quoted 30 lines · Grygorii Strashko

The gpiochip_add_data() may return -EPROBE_DEFER which is not handled properly by TI GPIO driver and causes unnecessary boot log messages.

Hence, add proper deferred probe handling with new dev_err_probe() API.

---
 drivers/gpio/gpio-omap.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpio/gpio-omap.c +2 -6
index f7ceb2b11afc..41952bb818ad 100644
@@ -1049,11 +1049,8 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
        irq->first = irq_base;
 
        ret = gpiochip_add_data(&bank->chip, bank);
-       if (ret) {
-               dev_err(bank->chip.parent,
-                       "Could not register gpio chip %d\n", ret);
-               return ret;
-       }
+       if (ret)
+               return dev_err_probe(bank->chip.parent, ret, "Could not register gpio chip\n");
 
        ret = devm_request_irq(bank->chip.parent, bank->irq,
                               omap_gpio_irq_handler,
--
Quoted 2 lines

2.17.1

Now applied. Thanks!

Bartosz