From patchwork Sat Jan 25 21:53:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 3539261 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 907329F2E9 for ; Sat, 25 Jan 2014 22:20:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2EAE2201BC for ; Sat, 25 Jan 2014 22:20:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E76C6201BB for ; Sat, 25 Jan 2014 22:20:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752215AbaAYWUw (ORCPT ); Sat, 25 Jan 2014 17:20:52 -0500 Received: from mail-yk0-f169.google.com ([209.85.160.169]:43563 "EHLO mail-yk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752104AbaAYWUv (ORCPT ); Sat, 25 Jan 2014 17:20:51 -0500 X-Greylist: delayed 1190 seconds by postgrey-1.27 at vger.kernel.org; Sat, 25 Jan 2014 17:20:51 EST Received: by mail-yk0-f169.google.com with SMTP id q9so7995144ykb.0 for ; Sat, 25 Jan 2014 14:20:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ceNI0++62q0aFd9f1avGIApLCAvx46kJcNkreMzCefs=; b=yiuP7AEvat6aTWk50CKtxlWXH957YkckT9tyhNkYlhmIA+/TA/bbcKyQ8nEYkKVIK1 1s/6frd/O1l6aHPOS0Q8yUlTGu4n9ahnjOacitAN8ZhHg/ZugOc1xGCkTdF5ZUmCpBbo sU3GK1jLLse9Qr3BzK/z8cNFnA/Cs+ST73FEAtC3VB5XTIjPT6F9+nZSIeg06AIJOiHv 2nMEXCT0agnhhrPhIiHGuJ8hsGNhBy9NsXekT3OruY52d9sUyYD1D86S9dEl0pBaGYOT z1WxudkaJorIn8Yo4Esez+SwGPUO5R+MDyCY1ESPfGpUqkK1GBkG/Eba1/G3YMuzFuBH DDxQ== X-Received: by 10.236.117.144 with SMTP id j16mr20218040yhh.19.1390686813138; Sat, 25 Jan 2014 13:53:33 -0800 (PST) Received: from localhost.localdomain ([189.101.178.124]) by mx.google.com with ESMTPSA id d32sm17155753yhq.27.2014.01.25.13.53.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 25 Jan 2014 13:53:32 -0800 (PST) From: Fabio Estevam To: chris@printf.net Cc: shawn.guo@linaro.org, linux-mmc@vger.kernel.org, Fabio Estevam Subject: [PATCH] mxs-mmc: Check the return value from clk_prepare_enable() Date: Sat, 25 Jan 2014 19:53:25 -0200 Message-Id: <1390686805-14771-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam clk_prepare_enable() may fail, so let's check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam --- 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 19633fe..69bc942 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -612,7 +612,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) { @@ -710,8 +712,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); } static const struct dev_pm_ops mxs_mmc_pm_ops = {