[PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains()

Peng Fan peng.fan at nxp.com
Tue Oct 3 02:49:56 PDT 2023


> Subject: [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in
> clk_imx_acm_attach_pm_domains()
> 
> The device_link_add() function returns NULL on error.  It doesn't return error
> pointers.  Fix the check accordingly.
> 
> Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
> Signed-off-by: Dan Carpenter <dan.carpenter at linaro.org>

Reviewed-by: Peng Fan <peng.fan at nxp.com>
> ---
>  drivers/clk/imx/clk-imx8-acm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c
> index 1e82f72b75c6..83019b986622 100644
> --- a/drivers/clk/imx/clk-imx8-acm.c
> +++ b/drivers/clk/imx/clk-imx8-acm.c
> @@ -287,9 +287,9 @@ static int clk_imx_acm_attach_pm_domains(struct
> device *dev,
> 
> DL_FLAG_STATELESS |
> 
> DL_FLAG_PM_RUNTIME |
> 
> DL_FLAG_RPM_ACTIVE);
> -		if (IS_ERR(dev_pm->pd_dev_link[i])) {
> +		if (!dev_pm->pd_dev_link[i]) {
>  			dev_pm_domain_detach(dev_pm->pd_dev[i], false);
> -			ret = PTR_ERR(dev_pm->pd_dev_link[i]);
> +			ret = -EINVAL;
>  			goto detach_pm;
>  		}
>  	}
> --
> 2.39.2




More information about the linux-arm-kernel mailing list