summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorR Raj Kumar <rrajk@nvidia.com>2014-01-08 16:42:41 +0530
committerR Raj Kumar <rrajk@nvidia.com>2014-01-09 01:10:41 -0800
commit41f0aeb44644e331dc0414c564b9cbc739afece4 (patch)
tree9afe6abba73541ebd26fac74ce39e271f520aee9 /drivers
parent4ecd5ac1204847401082c612878a028566ca456f (diff)
mmc: tegra: Verify return status of clock APIs
Added debug prints for verifying the return status of clock APIs that are used in the sdhci driver. Bug 1424839 Change-Id: Ifd5999314a2809d8995f9640bc730f1797ed8dee Signed-off-by: R Raj Kumar <rrajk@nvidia.com> Reviewed-on: http://git-master/r/353275 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/sdhci-tegra.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 5d83c64d3c08..98c479a855f9 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -1228,6 +1228,7 @@ static void tegra_sdhci_set_clock(struct sdhci_host *sdhci, unsigned int clock)
struct sdhci_tegra *tegra_host = pltfm_host->priv;
struct platform_device *pdev = to_platform_device(mmc_dev(sdhci->mmc));
u8 ctrl;
+ int ret = 0;
mutex_lock(&tegra_host->set_clock_mutex);
pr_debug("%s %s %u enabled=%u\n", __func__,
@@ -1235,7 +1236,12 @@ static void tegra_sdhci_set_clock(struct sdhci_host *sdhci, unsigned int clock)
if (clock) {
if (!tegra_host->clk_enabled) {
pm_runtime_get_sync(&pdev->dev);
- clk_prepare_enable(pltfm_host->clk);
+ ret = clk_prepare_enable(pltfm_host->clk);
+ if (ret) {
+ dev_err(mmc_dev(sdhci->mmc),
+ "clock enable is failed, ret: %d\n", ret);
+ return;
+ }
tegra_host->clk_enabled = true;
sdhci->is_clk_on = tegra_host->clk_enabled;
ctrl = sdhci_readb(sdhci, SDHCI_VNDR_CLK_CTRL);
@@ -1245,11 +1251,21 @@ static void tegra_sdhci_set_clock(struct sdhci_host *sdhci, unsigned int clock)
tegra_sdhci_set_clk_rate(sdhci, clock);
if (tegra_host->emc_clk && (!tegra_host->is_sdmmc_emc_clk_on)) {
- clk_prepare_enable(tegra_host->emc_clk);
+ ret = clk_prepare_enable(tegra_host->emc_clk);
+ if (ret) {
+ dev_err(mmc_dev(sdhci->mmc),
+ "clock enable is failed, ret: %d\n", ret);
+ return;
+ }
tegra_host->is_sdmmc_emc_clk_on = true;
}
if (tegra_host->sclk && (!tegra_host->is_sdmmc_sclk_on)) {
- clk_prepare_enable(tegra_host->sclk);
+ ret = clk_prepare_enable(tegra_host->sclk);
+ if (ret) {
+ dev_err(mmc_dev(sdhci->mmc),
+ "clock enable is failed, ret: %d\n", ret);
+ return;
+ }
tegra_host->is_sdmmc_sclk_on = true;
}
} else if (!clock && tegra_host->clk_enabled) {