pinctrl: imx: Fix NULL dereference in imx_pinctrl_probe()

When converting to ofnode `ofnode_read_u32` was accedentally used to
replace `fdtdec_get_int` instead of `ofnode_read_u32_default`.
Use `ofnode_read_u32_default` to fix this.

Fixes: 59382d2 ("pinctrl: imx: Convert to use livetree API for fdt access")
Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
This commit is contained in:
Jesse Taube
2025-01-16 22:00:48 -05:00
committed by Fabio Estevam
parent 252ad9890d
commit bb060231b6

View File

@@ -219,7 +219,7 @@ int imx_pinctrl_probe(struct udevice *dev,
if (info->flags & IMX8_USE_SCU)
return 0;
addr = ofnode_get_addr_size_index(dev_ofnode(dev), 0, &size);
addr = ofnode_get_addr_size_index(node, 0, &size);
if (addr == FDT_ADDR_T_NONE)
return -EINVAL;
@@ -228,7 +228,7 @@ int imx_pinctrl_probe(struct udevice *dev,
return -ENOMEM;
priv->info = info;
info->mux_mask = ofnode_read_u32(node, "fsl,mux_mask", 0);
info->mux_mask = ofnode_read_u32_default(node, "fsl,mux_mask", 0);
/*
* Refer to linux documentation for details:
* Documentation/devicetree/bindings/pinctrl/fsl,imx7d-pinctrl.txt