Skip to content

Commit 81a206d

Browse files
Yang Yingliangabelvesa
authored andcommitted
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: d3a0946 ("clk: imx: imx8: add audio clock mux driver") Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Peng Fan <[email protected]> Reviewed-by: Abel Vesa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abel Vesa <[email protected]>
1 parent 92888f3 commit 81a206d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/clk/imx/clk-imx8-acm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ static int clk_imx_acm_attach_pm_domains(struct device *dev,
294294
DL_FLAG_STATELESS |
295295
DL_FLAG_PM_RUNTIME |
296296
DL_FLAG_RPM_ACTIVE);
297-
if (IS_ERR(dev_pm->pd_dev_link[i])) {
297+
if (!dev_pm->pd_dev_link[i]) {
298298
dev_pm_domain_detach(dev_pm->pd_dev[i], false);
299-
ret = PTR_ERR(dev_pm->pd_dev_link[i]);
299+
ret = -EINVAL;
300300
goto detach_pm;
301301
}
302302
}

0 commit comments

Comments
 (0)