aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2013-07-03 16:02:38 -0400
committerChris Ball <cjb@laptop.org>2013-08-24 22:09:45 -0400
commit02c18c4737a7fc52d8a612d67c18f2900510dae3 (patch)
tree27ab81be1eee8a4793a6cb81ffd0e2a81cbcdd0c /drivers/mmc
parenta5adbffda8d88a9e96c579b337b12cc8a6863575 (diff)
mmc: mxs-mmc: Check the return value from stmp_reset_block()
stmp_reset_block() may fail, so let's check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mxs-mmc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index b76778fe81b0..e1fa3ef735e0 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -102,12 +102,15 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
102 BM_SSP_STATUS_CARD_DETECT) ^ host->cd_inverted; 102 BM_SSP_STATUS_CARD_DETECT) ^ host->cd_inverted;
103} 103}
104 104
105static void mxs_mmc_reset(struct mxs_mmc_host *host) 105static int mxs_mmc_reset(struct mxs_mmc_host *host)
106{ 106{
107 struct mxs_ssp *ssp = &host->ssp; 107 struct mxs_ssp *ssp = &host->ssp;
108 u32 ctrl0, ctrl1; 108 u32 ctrl0, ctrl1;
109 int ret;
109 110
110 stmp_reset_block(ssp->base); 111 ret = stmp_reset_block(ssp->base);
112 if (ret)
113 return ret;
111 114
112 ctrl0 = BM_SSP_CTRL0_IGNORE_CRC; 115 ctrl0 = BM_SSP_CTRL0_IGNORE_CRC;
113 ctrl1 = BF_SSP(0x3, CTRL1_SSP_MODE) | 116 ctrl1 = BF_SSP(0x3, CTRL1_SSP_MODE) |
@@ -132,6 +135,7 @@ static void mxs_mmc_reset(struct mxs_mmc_host *host)
132 135
133 writel(ctrl0, ssp->base + HW_SSP_CTRL0); 136 writel(ctrl0, ssp->base + HW_SSP_CTRL0);
134 writel(ctrl1, ssp->base + HW_SSP_CTRL1(ssp)); 137 writel(ctrl1, ssp->base + HW_SSP_CTRL1(ssp));
138 return 0;
135} 139}
136 140
137static void mxs_mmc_start_cmd(struct mxs_mmc_host *host, 141static void mxs_mmc_start_cmd(struct mxs_mmc_host *host,
@@ -625,7 +629,11 @@ static int mxs_mmc_probe(struct platform_device *pdev)
625 } 629 }
626 clk_prepare_enable(ssp->clk); 630 clk_prepare_enable(ssp->clk);
627 631
628 mxs_mmc_reset(host); 632 ret = mxs_mmc_reset(host);
633 if (ret) {
634 dev_err(&pdev->dev, "Failed to reset mmc: %d\n", ret);
635 goto out_clk_disable;
636 }
629 637
630 ssp->dmach = dma_request_slave_channel(&pdev->dev, "rx-tx"); 638 ssp->dmach = dma_request_slave_channel(&pdev->dev, "rx-tx");
631 if (!ssp->dmach) { 639 if (!ssp->dmach) {