diff options
Diffstat (limited to 'drivers/tty/serial/sccnxp.c')
-rw-r--r-- | drivers/tty/serial/sccnxp.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c index cdd2f942317c..b9c7a904c1ea 100644 --- a/drivers/tty/serial/sccnxp.c +++ b/drivers/tty/serial/sccnxp.c | |||
@@ -889,7 +889,16 @@ static int sccnxp_probe(struct platform_device *pdev) | |||
889 | goto err_out; | 889 | goto err_out; |
890 | uartclk = 0; | 890 | uartclk = 0; |
891 | } else { | 891 | } else { |
892 | clk_prepare_enable(clk); | 892 | ret = clk_prepare_enable(clk); |
893 | if (ret) | ||
894 | goto err_out; | ||
895 | |||
896 | ret = devm_add_action_or_reset(&pdev->dev, | ||
897 | (void(*)(void *))clk_disable_unprepare, | ||
898 | clk); | ||
899 | if (ret) | ||
900 | goto err_out; | ||
901 | |||
893 | uartclk = clk_get_rate(clk); | 902 | uartclk = clk_get_rate(clk); |
894 | } | 903 | } |
895 | 904 | ||
@@ -988,7 +997,7 @@ static int sccnxp_probe(struct platform_device *pdev) | |||
988 | uart_unregister_driver(&s->uart); | 997 | uart_unregister_driver(&s->uart); |
989 | err_out: | 998 | err_out: |
990 | if (!IS_ERR(s->regulator)) | 999 | if (!IS_ERR(s->regulator)) |
991 | return regulator_disable(s->regulator); | 1000 | regulator_disable(s->regulator); |
992 | 1001 | ||
993 | return ret; | 1002 | return ret; |
994 | } | 1003 | } |