[PATCH 06/20] pinctrl/rockchip: parse dt only if the fwnode is of node

From: Jianqun Xu
Date: Tue Sep 20 2022 - 06:31:44 EST


Check if the fwnode is a of node before parsing dt, otherwise return a
'0' to allow driver to continue.

Signed-off-by: Jianqun Xu <jay.xu@xxxxxxxxxxxxxx>
---
drivers/pinctrl/pinctrl-rockchip.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 42aa3552417a..7b8d3bff9721 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -3038,6 +3038,9 @@ static int rockchip_pinctrl_parse_dt(struct platform_device *pdev,
int ret;
int i;

+ if (!is_of_node(fwnode))
+ return 0;
+
rockchip_pinctrl_child_count(info, np);

dev_dbg(dev, "nfunctions = %d\n", info->nfunctions);
--
2.25.1