[U-Boot] [PATCH] dm: pinctrl: Skip not associated gpio phandle and rise an error message
Simon Glass
sjg at chromium.org
Tue Sep 17 05:48:14 UTC 2019
Hi Michael,
On Sun, 15 Sep 2019 at 04:45, Michael Trimarchi
<michael at amarulasolutions.com> wrote:
>
> Skip not associated gpio phandle let register the other gpios and
> the error message add some information to debug the problem using
> a decompiled version of the dts
>
> dtc -I dtb -O dts -o devicetree.dts spl/u-boot-spl.dtb
>
> Signed-off-by: Michael Trimarchi <michael at amarulasolutions.com>
> ---
> drivers/pinctrl/pinctrl-uclass.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
> index 5b1cd29d86..87b0c3e35b 100644
> --- a/drivers/pinctrl/pinctrl-uclass.c
> +++ b/drivers/pinctrl/pinctrl-uclass.c
> @@ -91,12 +91,18 @@ static int pinctrl_select_state_full(struct udevice *dev, const char *statename)
> phandle = fdt32_to_cpu(*list++);
> ret = uclass_get_device_by_phandle_id(UCLASS_PINCONFIG, phandle,
> &config);
> - if (ret)
> - return ret;
> + if (ret) {
> + dev_err(dev, "%s: uclass_get_device_by_phandle_id: err=%d\n",
> + __func__, ret);
> + continue;
If is is an error, why continue?
Perhaps a warning or a log_debug() instead?
> + }
>
> ret = pinctrl_config_one(config);
> - if (ret)
> - return ret;
> + if (ret) {
> + dev_err(dev, "%s: pinctrl_config_one: err=%d\n",
> + __func__, ret);
> + continue;
> + }
> }
>
> return 0;
> --
> 2.17.1
>
Regards,
Simon
More information about the U-Boot
mailing list