Re: [PATCH] gpio: mvebu: fail probe if gpiochip registration fails

From: Linus Walleij

Date: Mon Jun 15 2026 - 08:44:56 EST


On Mon, Jun 15, 2026 at 11:21 AM Pengpeng Hou <pengpeng@xxxxxxxxxxx> wrote:

> The MVEBU GPIO probe path ignores the return value from
> devm_gpiochip_add_data(). If gpiochip registration fails, probe still
> continues into optional PWM and IRQ-domain setup as if the GPIO provider
> had been registered successfully.
>
> Propagate the gpiochip registration error and stop probing in that case.
>
> Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
(...)
> - devm_gpiochip_add_data(&pdev->dev, &mvchip->chip, mvchip);
> + err = devm_gpiochip_add_data(&pdev->dev, &mvchip->chip, mvchip);
> + if (err)
> + return err;

Can't you use dev_err_probe() here like in the other patch
you sent?

Yours,
Linus Walleij