From patchwork Tue Oct 21 17:19:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 39206 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2C3BE24041 for ; Tue, 21 Oct 2014 17:19:41 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf1115773lbg.1 for ; Tue, 21 Oct 2014 10:19:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=B/xpYCZkaPKUJ/gcYwaH6MBJKFX7CUFZCZ9epJ2otX8=; b=BNnttlpAqVwoxwDmczGFJtuPWuBFwk0yJ7R32yn/p2V02vM6zpay2NiRwaS1YDk6Rz rAkHW0K4u+wXanoGUUWraWr5WCCgJQ+C73huIeD9qpbWqMCJ8pRWonyAFARq7ysq9Fe4 KFKP3mPv19zqf24ci+7+enA9Nbc3QDuhp73wYUH6v0evTtAPkIxdBM6knxi1+S7Sxcwd HDDSmUf6kPx9JhS7OGFpyvp8dmxXPcayEBq6V8UAZoDw/ypyi3B7J6o2R2vo51E9Hxr+ UO/SCPaLllSzRYJMRkDK7apGiHr2vUH4TWFbDeAalXRyt4Efaup/wHqIdO9T5PE4yP9y uZQQ== X-Gm-Message-State: ALoCoQkzzgUmizgjAW/93CvABQZxYCh6J+xTCIBCHRd2B7hYv6VUDjLMkUrnVwNbRAVbcEOTisZZ X-Received: by 10.180.182.164 with SMTP id ef4mr3797435wic.0.1413911979597; Tue, 21 Oct 2014 10:19:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.169 with SMTP id ld9ls86619lab.12.gmail; Tue, 21 Oct 2014 10:19:39 -0700 (PDT) X-Received: by 10.112.73.103 with SMTP id k7mr20766202lbv.41.1413911979362; Tue, 21 Oct 2014 10:19:39 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id am6si19906304lac.124.2014.10.21.10.19.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 10:19:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id w7so1402274lbi.8 for ; Tue, 21 Oct 2014 10:19:39 -0700 (PDT) X-Received: by 10.152.6.228 with SMTP id e4mr36244478laa.71.1413911979288; Tue, 21 Oct 2014 10:19:39 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.84.229 with SMTP id c5csp545268lbz; Tue, 21 Oct 2014 10:19:39 -0700 (PDT) X-Received: by 10.112.151.210 with SMTP id us18mr36602720lbb.17.1413911978945; Tue, 21 Oct 2014 10:19:38 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id v3si19891682lal.134.2014.10.21.10.19.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 10:19:38 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id hz20so1464001lab.39 for ; Tue, 21 Oct 2014 10:19:38 -0700 (PDT) X-Received: by 10.112.254.162 with SMTP id aj2mr36735574lbd.70.1413911978843; Tue, 21 Oct 2014 10:19:38 -0700 (PDT) Received: from uffe-Latitude-E6430s.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id uh7sm4791085lac.1.2014.10.21.10.19.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Oct 2014 10:19:37 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Chris Ball Subject: [PATCH 11/15] mmc: block: Use mmc_get_ext_csd() instead of mmc_send_ext_csd() Date: Tue, 21 Oct 2014 19:19:09 +0200 Message-Id: <1413911953-19012-12-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413911953-19012-1-git-send-email-ulf.hansson@linaro.org> References: <1413911953-19012-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , By using mmc_get_ext_csd() in favor of mmc_send_ext_csd, we decrease code duplication. Signed-off-by: Ulf Hansson --- drivers/mmc/card/block.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 1fa4c80..1795285 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1308,19 +1308,11 @@ static int mmc_blk_packed_err_check(struct mmc_card *card, } if (status & R1_EXCEPTION_EVENT) { - ext_csd = kzalloc(512, GFP_KERNEL); - if (!ext_csd) { - pr_err("%s: unable to allocate buffer for ext_csd\n", - req->rq_disk->disk_name); - return -ENOMEM; - } - - err = mmc_send_ext_csd(card, ext_csd); + err = mmc_get_ext_csd(card, &ext_csd); if (err) { pr_err("%s: error %d sending ext_csd\n", req->rq_disk->disk_name, err); - check = MMC_BLK_ABORT; - goto free; + return MMC_BLK_ABORT; } if ((ext_csd[EXT_CSD_EXP_EVENTS_STATUS] & @@ -1338,7 +1330,6 @@ static int mmc_blk_packed_err_check(struct mmc_card *card, req->rq_disk->disk_name, packed->nr_entries, packed->blocks, packed->idx_failure); } -free: kfree(ext_csd); }