diff mbox

[3/3] mmc: mxs-mmc: Check for clk_prepare_enable() error

Message ID 1416403019-6353-3-git-send-email-fabio.estevam@freescale.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fabio Estevam Nov. 19, 2014, 1:16 p.m. UTC
clk_prepare_enable() may fail and in this case we should propagate the error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/mmc/host/mxs-mmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Ulf Hansson Nov. 24, 2014, 8:36 a.m. UTC | #1
On 19 November 2014 at 14:16, Fabio Estevam <fabio.estevam@freescale.com> wrote:
> clk_prepare_enable() may fail and in this case we should propagate the error.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Thanks! Applied for next.

Kind regards
Uffe


> ---
>  drivers/mmc/host/mxs-mmc.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index f2c49e0..60c4ca9 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -619,7 +619,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>                 ret = PTR_ERR(ssp->clk);
>                 goto out_mmc_free;
>         }
> -       clk_prepare_enable(ssp->clk);
> +       ret = clk_prepare_enable(ssp->clk);
> +       if (ret)
> +               goto out_mmc_free;
>
>         ret = mxs_mmc_reset(host);
>         if (ret) {
> @@ -719,8 +721,7 @@ static int mxs_mmc_resume(struct device *dev)
>         struct mxs_mmc_host *host = mmc_priv(mmc);
>         struct mxs_ssp *ssp = &host->ssp;
>
> -       clk_prepare_enable(ssp->clk);
> -       return 0;
> +       return clk_prepare_enable(ssp->clk);
>  }
>  #endif
>
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index f2c49e0..60c4ca9 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -619,7 +619,9 @@  static int mxs_mmc_probe(struct platform_device *pdev)
 		ret = PTR_ERR(ssp->clk);
 		goto out_mmc_free;
 	}
-	clk_prepare_enable(ssp->clk);
+	ret = clk_prepare_enable(ssp->clk);
+	if (ret)
+		goto out_mmc_free;
 
 	ret = mxs_mmc_reset(host);
 	if (ret) {
@@ -719,8 +721,7 @@  static int mxs_mmc_resume(struct device *dev)
 	struct mxs_mmc_host *host = mmc_priv(mmc);
 	struct mxs_ssp *ssp = &host->ssp;
 
-	clk_prepare_enable(ssp->clk);
-	return 0;
+	return clk_prepare_enable(ssp->clk);
 }
 #endif