[PATCH 3/3] clk: imx: imx8qxp-lpcg: Return an error if the parent names cannot be read

Frank Li Frank.li at oss.nxp.com
Mon Nov 2 13:26:30 PST 2026


On Mon, Nov 02, 2026 at 01:48:51PM +0200, Abel Vesa wrote:
> 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>
> ---

Reviewed-by: Frank Li <Frank.Li at nxp.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