diff mbox series

[U-Boot,V2] dm: pinctrl: Skip not associated gpio phandle and rise a warning message

Message ID 20190917200602.GA17528@panicking
State Accepted
Commit 36a90eda84dec49c2c850852d7e246c9a01bf59c
Delegated to: Simon Glass
Headers show
Series [U-Boot,V2] dm: pinctrl: Skip not associated gpio phandle and rise a warning message | expand

Commit Message

Michael Nazzareno Trimarchi Sept. 17, 2019, 8:06 p.m. UTC
Skip not associated gpio phandle let register the other gpios on a group.
We need anyway to send out a warning to the user to fix their uboot-board.dtsi.
Thhe handle id can be found inside the decompiled dtb

dtc -I dtb -O dts -o devicetree.dts spl/u-boot-spl.dtb

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
V1 -> V2:
	- move dev_err to dev_warn
	- adjust the commit message
---
 drivers/pinctrl/pinctrl-uclass.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Comments

Simon Glass Sept. 18, 2019, 2:27 a.m. UTC | #1
On Tue, 17 Sep 2019 at 13:06, Michael Trimarchi
<michael@amarulasolutions.com> wrote:
>
> Skip not associated gpio phandle let register the other gpios on a group.
> We need anyway to send out a warning to the user to fix their uboot-board.dtsi.
> Thhe handle id can be found inside the decompiled dtb
>
> dtc -I dtb -O dts -o devicetree.dts spl/u-boot-spl.dtb
>
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> ---
> V1 -> V2:
>         - move dev_err to dev_warn
>         - adjust the commit message
> ---
>  drivers/pinctrl/pinctrl-uclass.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass Sept. 27, 2019, 11:28 p.m. UTC | #2
On Tue, 17 Sep 2019 at 13:06, Michael Trimarchi
<michael@amarulasolutions.com> wrote:
>
> Skip not associated gpio phandle let register the other gpios on a group.
> We need anyway to send out a warning to the user to fix their uboot-board.dtsi.
> Thhe handle id can be found inside the decompiled dtb
>
> dtc -I dtb -O dts -o devicetree.dts spl/u-boot-spl.dtb
>
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> ---
> V1 -> V2:
>         - move dev_err to dev_warn
>         - adjust the commit message
> ---
>  drivers/pinctrl/pinctrl-uclass.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm/next, thanks!
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
index 5b1cd29d86..7d98fbc4ec 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_warn(dev, "%s: uclass_get_device_by_phandle_id: err=%d\n",
+				__func__, ret);
+			continue;
+		}
 
 		ret = pinctrl_config_one(config);
-		if (ret)
-			return ret;
+		if (ret) {
+			dev_warn(dev, "%s: pinctrl_config_one: err=%d\n",
+				__func__, ret);
+			continue;
+		}
 	}
 
 	return 0;