In case the uart registration fails the clocks are left enabled. Disable the clock in case of errors. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xxxxxxxxxx> --- drivers/tty/serial/uartlite.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index f42ccc4..39ea495 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -799,7 +799,7 @@ static int ulite_probe(struct platform_device *pdev) ret = uart_register_driver(&ulite_uart_driver); if (ret < 0) { dev_err(&pdev->dev, "Failed to register driver\n"); - return ret; + goto err_out_clk_disable; } } @@ -808,6 +808,10 @@ static int ulite_probe(struct platform_device *pdev) clk_disable(pdata->clk); return ret; + +err_out_clk_disable: + clk_disable_unprepare(pdata->clk); + return ret; } static int ulite_remove(struct platform_device *pdev) -- 2.1.1