From patchwork Wed Jul 3 20:02:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 2820071 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 DE4359F3C3 for ; Wed, 3 Jul 2013 20:09:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B4BC520151 for ; Wed, 3 Jul 2013 20:09:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC4F7200CA for ; Wed, 3 Jul 2013 20:09:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933078Ab3GCUJc (ORCPT ); Wed, 3 Jul 2013 16:09:32 -0400 Received: from mail-gg0-f169.google.com ([209.85.161.169]:57812 "EHLO mail-gg0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932690Ab3GCUJb (ORCPT ); Wed, 3 Jul 2013 16:09:31 -0400 Received: by mail-gg0-f169.google.com with SMTP id b1so160244ggn.0 for ; Wed, 03 Jul 2013 13:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=wYdKtOq+7PcaV5CMDBObZucMLNQk+5U+mAxAKIcpggs=; b=rfSC5VIYXNjoW9P7F4bCZbGBaAZayIXaV4e1zG7LzZ2SZ4FN4DhzGhBWEEoCRDrxy5 KJVUKb4ZVdQ9/bH2gd7Wu3rG+IzAxQVveemZbYdDZe1R7UIYEA8FJEzCNv48fiEMQY7o HVcNGaZ08qwWsbgrOHGzyE1HQyJKJvvlb8Wql+ZCPW4ryZAjJyShg7iStMY2yF1AvfhY bB5Ln1Xrh2GcacSW5prCMTxC2OtxC4ffQXx1R38ij17iMzvjN4cEdnH5YLgH9ndeDFkV 0nlQ2/T3idEwvOxn9aSbCNhLTNnotJzwY1POg3d1xJQi5pkZNkkvsP0Cfg7uU1uFwVpe jdyQ== X-Received: by 10.236.136.200 with SMTP id w48mr1076459yhi.74.1372881776534; Wed, 03 Jul 2013 13:02:56 -0700 (PDT) Received: from localhost.localdomain ([187.106.36.171]) by mx.google.com with ESMTPSA id w12sm48300921yhj.19.2013.07.03.13.02.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Jul 2013 13:02:56 -0700 (PDT) From: Fabio Estevam To: cjb@laptop.org Cc: shawn.guo@linaro.org, kernel@pengutronix.de, linux-mmc@vger.kernel.org, Fabio Estevam Subject: [PATCH 2/2] mmc: mxs-mmc: Check the return value from stmp_reset_block() Date: Wed, 3 Jul 2013 17:02:38 -0300 Message-Id: <1372881758-23502-2-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1372881758-23502-1-git-send-email-festevam@gmail.com> References: <1372881758-23502-1-git-send-email-festevam@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 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 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 --- 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) {