|
@@ -889,7 +889,16 @@ static int sccnxp_probe(struct platform_device *pdev)
|
|
|
goto err_out;
|
|
|
uartclk = 0;
|
|
|
} else {
|
|
|
- clk_prepare_enable(clk);
|
|
|
+ ret = clk_prepare_enable(clk);
|
|
|
+ if (ret)
|
|
|
+ goto err_out;
|
|
|
+
|
|
|
+ ret = devm_add_action_or_reset(&pdev->dev,
|
|
|
+ (void(*)(void *))clk_disable_unprepare,
|
|
|
+ clk);
|
|
|
+ if (ret)
|
|
|
+ goto err_out;
|
|
|
+
|
|
|
uartclk = clk_get_rate(clk);
|
|
|
}
|
|
|
|
|
@@ -988,7 +997,7 @@ static int sccnxp_probe(struct platform_device *pdev)
|
|
|
uart_unregister_driver(&s->uart);
|
|
|
err_out:
|
|
|
if (!IS_ERR(s->regulator))
|
|
|
- return regulator_disable(s->regulator);
|
|
|
+ regulator_disable(s->regulator);
|
|
|
|
|
|
return ret;
|
|
|
}
|