OSDN Git Service

tty: serial: uartlite: Enable clocks at probe
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Mon, 6 Aug 2018 08:52:11 +0000 (14:22 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Sep 2018 14:07:23 +0000 (16:07 +0200)
At probe the uartlite is getting configured.
Enable the clocks before assiging uart and
disable after probe is done.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/uartlite.c

index 98d3ead..69411b6 100644 (file)
@@ -776,13 +776,17 @@ static int ulite_probe(struct platform_device *pdev)
                pdata->clk = NULL;
        }
 
-       ret = clk_prepare(pdata->clk);
+       ret = clk_prepare_enable(pdata->clk);
        if (ret) {
                dev_err(&pdev->dev, "Failed to prepare clock\n");
                return ret;
        }
 
-       return ulite_assign(&pdev->dev, id, res->start, irq, pdata);
+       ret = ulite_assign(&pdev->dev, id, res->start, irq, pdata);
+
+       clk_disable(pdata->clk);
+
+       return ret;
 }
 
 static int ulite_remove(struct platform_device *pdev)