From: Fabio Estevam <festevam@gmail.com>
To: cjb@laptop.org
Cc: shawn.guo@linaro.org, kernel@pengutronix.de,
linux-mmc@vger.kernel.org,
Fabio Estevam <fabio.estevam@freescale.com>
Subject: [PATCH 2/2] mmc: mxs-mmc: Check the return value from stmp_reset_block()
Date: Wed, 3 Jul 2013 17:02:38 -0300 [thread overview]
Message-ID: <1372881758-23502-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1372881758-23502-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@freescale.com>
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>
---
drivers/mmc/host/mxs-mmc.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index b76778f..383830d 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)
BM_SSP_STATUS_CARD_DETECT) ^ host->cd_inverted;
}
-static void mxs_mmc_reset(struct mxs_mmc_host *host)
+static int mxs_mmc_reset(struct mxs_mmc_host *host)
{
struct mxs_ssp *ssp = &host->ssp;
u32 ctrl0, ctrl1;
-
- stmp_reset_block(ssp->base);
+ int ret;
+
+ ret = stmp_reset_block(ssp->base);
+ if (ret)
+ return ret;
ctrl0 = BM_SSP_CTRL0_IGNORE_CRC;
ctrl1 = BF_SSP(0x3, CTRL1_SSP_MODE) |
@@ -132,6 +135,7 @@ static void mxs_mmc_reset(struct mxs_mmc_host *host)
writel(ctrl0, ssp->base + HW_SSP_CTRL0);
writel(ctrl1, ssp->base + HW_SSP_CTRL1(ssp));
+ return 0;
}
static void mxs_mmc_start_cmd(struct mxs_mmc_host *host,
@@ -625,7 +629,11 @@ static int mxs_mmc_probe(struct platform_device *pdev)
}
clk_prepare_enable(ssp->clk);
- mxs_mmc_reset(host);
+ ret = mxs_mmc_reset(host);
+ if (ret) {
+ dev_err(&pdev->dev, "Failed to reset mmc: %d\n", ret);
+ goto out_clk_disable;
+ }
ssp->dmach = dma_request_slave_channel(&pdev->dev, "rx-tx");
if (!ssp->dmach) {
--
1.8.1.2
next prev parent reply other threads:[~2013-07-03 20:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-03 20:02 [PATCH 1/2] mmc: mxs-mmc: Use devm_clk_get() Fabio Estevam
2013-07-03 20:02 ` Fabio Estevam [this message]
2013-07-04 1:27 ` Shawn Guo
2013-08-25 2:07 ` Chris Ball
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1372881758-23502-2-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=cjb@laptop.org \
--cc=fabio.estevam@freescale.com \
--cc=kernel@pengutronix.de \
--cc=linux-mmc@vger.kernel.org \
--cc=shawn.guo@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox