[PATCH 3/3] clk: imx: imx8qxp-lpcg: Return an error if the parent names cannot be read
Abel Vesa
abel.vesa at oss.qualcomm.com
Mon Nov 2 03:48:51 PST 2026
When of_clk_parent_fill() does not fill in a parent name for every
clock, imx_lpcg_parse_clks_from_dt() returns the number of clocks
instead of an error code. The probe then falls back to the legacy
binding as it does on any error, but a positive value is not what the
function is meant to return on failure.
Return -EINVAL instead, like the other parsing errors do.
Fixes: d5f1e6a2bb61 ("clk: imx: imx8qxp-lpcg: add parsing clocks from device tree")
Signed-off-by: Abel Vesa <abel.vesa at oss.qualcomm.com>
---
drivers/clk/imx/clk-imx8qxp-lpcg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/imx/clk-imx8qxp-lpcg.c b/drivers/clk/imx/clk-imx8qxp-lpcg.c
index ae8cb5408246..4070e06f9c7d 100644
--- a/drivers/clk/imx/clk-imx8qxp-lpcg.c
+++ b/drivers/clk/imx/clk-imx8qxp-lpcg.c
@@ -231,7 +231,7 @@ static int imx_lpcg_parse_clks_from_dt(struct platform_device *pdev,
ret = of_clk_parent_fill(np, parent_names, count);
if (ret != count) {
dev_err(&pdev->dev, "failed to get clock parent names\n");
- return count;
+ return -EINVAL;
}
ret = of_property_read_string_array(np, "clock-output-names",
--
2.54.0
More information about the linux-arm-kernel
mailing list