Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: imx: imx8-acm: Fix return value check in clk_imx_acm_attach_pm_domains()

If device_link_add() fails, it returns NULL pointer not ERR_PTR(),
replace IS_ERR() with NULL pointer check, and return -EINVAL.

Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20241026112452.1523-1-yangyingliang@huaweicloud.com
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

authored by

Yang Yingliang and committed by
Abel Vesa
81a206d7 92888f39

+2 -2
+2 -2
drivers/clk/imx/clk-imx8-acm.c
··· 294 294 DL_FLAG_STATELESS | 295 295 DL_FLAG_PM_RUNTIME | 296 296 DL_FLAG_RPM_ACTIVE); 297 - if (IS_ERR(dev_pm->pd_dev_link[i])) { 297 + if (!dev_pm->pd_dev_link[i]) { 298 298 dev_pm_domain_detach(dev_pm->pd_dev[i], false); 299 - ret = PTR_ERR(dev_pm->pd_dev_link[i]); 299 + ret = -EINVAL; 300 300 goto detach_pm; 301 301 } 302 302 }