tegra: ehci: clock disable
Suresh Mangipudi [Thu, 4 Aug 2011 12:30:28 +0000 (17:30 +0530)]
Disable the clock only when the device clocks are enabled.

Bug 858490

Original-Change-Id: I2f22890b11ec98b88457ffe6c90411f9927d8390
Reviewed-on: http://git-master/r/45007
Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com>
Tested-by: Suresh Mangipudi <smangipudi@nvidia.com>
Tested-by: Bala Murali Krishna <balam@nvidia.com>
Reviewed-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com>

Rebase-Id: R7a42a8bb412327a2c1d84877d84b722e33092ce9

drivers/usb/host/ehci-tegra.c

index 1bf667a..c10f66e 100644 (file)
@@ -1162,10 +1162,11 @@ static int tegra_ehci_remove(struct platform_device *pdev)
        clk_disable(tegra->clk);
        clk_put(tegra->clk);
 
-       clk_disable(tegra->sclk_clk);
+       if (tegra->clock_enabled){
+               clk_disable(tegra->sclk_clk);
+               clk_disable(tegra->emc_clk);
+       }
        clk_put(tegra->sclk_clk);
-
-       clk_disable(tegra->emc_clk);
        clk_put(tegra->emc_clk);
 
        kfree(tegra);