tty: serial: uartlite: Disable clocks in case of errors
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Tue, 13 Jul 2021 06:48:34 +0000 (12:18 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jul 2021 10:46:52 +0000 (12:46 +0200)
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@xilinx.com>
Link: https://lore.kernel.org/r/20210713064835.27978-2-shubhrajyoti.datta@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/uartlite.c

index a5f15f22d9efed304e431c921b740fc23ce75cda..0376c8607e898a9924c2666e814ea536bb02de2d 100644 (file)
@@ -784,6 +784,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");
+                       clk_disable_unprepare(pdata->clk);
                        return ret;
                }
        }