Skip to content

Commit 51e321f

Browse files
Yang Yingliangarndb
authored andcommitted
soc: aspeed-lpc-ctrl: Fix clock cleanup in error path
Move syscon_regmap_lookup_by_compatible() above the devm_clk_get() to avoid missing clk_disable_unprepare(). Fixes: 2f9b25f ("soc: aspeed: Re-enable FWH2AHB on AST2600") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Joel Stanley <[email protected]> Reviewed-by: Joel Stanley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected]' Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 9664efe commit 51e321f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/soc/aspeed/aspeed-lpc-ctrl.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,16 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev)
295295
return -ENODEV;
296296
}
297297

298+
if (of_device_is_compatible(dev->of_node, "aspeed,ast2600-lpc-ctrl")) {
299+
lpc_ctrl->fwh2ahb = true;
300+
301+
lpc_ctrl->scu = syscon_regmap_lookup_by_compatible("aspeed,ast2600-scu");
302+
if (IS_ERR(lpc_ctrl->scu)) {
303+
dev_err(dev, "couldn't find scu\n");
304+
return PTR_ERR(lpc_ctrl->scu);
305+
}
306+
}
307+
298308
lpc_ctrl->clk = devm_clk_get(dev, NULL);
299309
if (IS_ERR(lpc_ctrl->clk)) {
300310
dev_err(dev, "couldn't get clock\n");
@@ -306,16 +316,6 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev)
306316
return rc;
307317
}
308318

309-
if (of_device_is_compatible(dev->of_node, "aspeed,ast2600-lpc-ctrl")) {
310-
lpc_ctrl->fwh2ahb = true;
311-
312-
lpc_ctrl->scu = syscon_regmap_lookup_by_compatible("aspeed,ast2600-scu");
313-
if (IS_ERR(lpc_ctrl->scu)) {
314-
dev_err(dev, "couldn't find scu\n");
315-
return PTR_ERR(lpc_ctrl->scu);
316-
}
317-
}
318-
319319
lpc_ctrl->miscdev.minor = MISC_DYNAMIC_MINOR;
320320
lpc_ctrl->miscdev.name = DEVICE_NAME;
321321
lpc_ctrl->miscdev.fops = &aspeed_lpc_ctrl_fops;

0 commit comments

Comments
 (0)