From patchwork Thu Mar 22 10:47:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 7407 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7219F23E2F for ; Thu, 22 Mar 2012 10:48:58 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1A6F0A18405 for ; Thu, 22 Mar 2012 10:48:58 +0000 (UTC) Received: by iage36 with SMTP id e36so3888721iag.11 for ; Thu, 22 Mar 2012 03:48:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=byjp+t4fyflN1NT48oS3KPmOp/mp1b9DReUPckNrkmg=; b=mmc0ZbvkV55gi6Lw9fVYD8el4SlFlmp2AGKSYnXCFrAEuDzxxKqQ5LgTrdxY+p1pN7 tTejuClWagHQnop0oBENJJXwXIP48Cd206X6etBcTl87HxE82+e7luKoF2n7Y/IzRhUS B1WCAu+74mt8cfn0PoRlLigV6B5h873cjRc1sFlxolAXfff+kcootG8n0SiV+yffqQCG r7OfPe62qBB720/X+qCfgN/i99LQvq+NYhVwNbpYiTGhaWmdy+teLyUVVUFaB9duBEkJ OZhiNHfOPOavYRowCYvQD6/lb2XYJnvauwXHUfdRYz0b/Hzk6qQPpH5hY6yjsqqtx3VW BCzg== Received: by 10.50.183.163 with SMTP id en3mr1050786igc.12.1332413337519; Thu, 22 Mar 2012 03:48:57 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.203.79 with SMTP id fh15csp44551ibb; Thu, 22 Mar 2012 03:48:56 -0700 (PDT) Received: by 10.14.99.6 with SMTP id w6mr1023994eef.68.1332413335976; Thu, 22 Mar 2012 03:48:55 -0700 (PDT) Received: from eu1sys200aog117.obsmtp.com (eu1sys200aog117.obsmtp.com. [207.126.144.143]) by mx.google.com with SMTP id i4si1281064eea.149.2012.03.22.03.48.52 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Mar 2012 03:48:55 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.143 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.143; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.143 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob117.postini.com ([207.126.147.11]) with SMTP ID DSNKT2sDhUwmZ/QjEw6Zpd/J4kQgm4BahkWK@postini.com; Thu, 22 Mar 2012 10:48:55 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 42B42AE; Thu, 22 Mar 2012 10:39:18 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id DAA7272C; Thu, 22 Mar 2012 10:47:41 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id DB7AFA807E; Thu, 22 Mar 2012 11:47:36 +0100 (CET) Received: from steludxu4020.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 22 Mar 2012 11:47:40 +0100 From: Ulf Hansson To: , Chris Ball Cc: Subhash Jadavani , Per Forlin , Ulf Hansson , Johan Rudholm , Lee Jones Subject: [PATCH] mmc: block: Remove use of mmc_blk_set_blksize Date: Thu, 22 Mar 2012 11:47:26 +0100 Message-ID: <1332413246-27953-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.9 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmqKdWqV+2aups0xf1xgAmldx1d90vdpy2BqJFpDfOj3WwYAnJWKEH5KNXaycHTGdOjoNor According to the specifications for SD and (e)MMC default blocksize (named BLOCKLEN in Spec.) must always be 512 bytes. Since we hardcoded to always use 512 bytes, we do not explicitly have to set it. Future improvements should potentially make it possible to use a greater blocksize than 512 bytes, but until then let's skip this. Signed-off-by: Ulf Hansson --- drivers/mmc/card/block.c | 27 +-------------------------- 1 files changed, 1 insertions(+), 26 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index a7c75d8..ce171c6 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1624,24 +1624,6 @@ static int mmc_blk_alloc_parts(struct mmc_card *card, struct mmc_blk_data *md) return ret; } -static int -mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card) -{ - int err; - - mmc_claim_host(card->host); - err = mmc_set_blocklen(card, 512); - mmc_release_host(card->host); - - if (err) { - pr_err("%s: unable to set block size to 512: %d\n", - md->disk->disk_name, err); - return -EINVAL; - } - - return 0; -} - static void mmc_blk_remove_req(struct mmc_blk_data *md) { struct mmc_card *card; @@ -1769,7 +1751,6 @@ static const struct mmc_fixup blk_fixups[] = static int mmc_blk_probe(struct mmc_card *card) { struct mmc_blk_data *md, *part_md; - int err; char cap_str[10]; /* @@ -1782,10 +1763,6 @@ static int mmc_blk_probe(struct mmc_card *card) if (IS_ERR(md)) return PTR_ERR(md); - err = mmc_blk_set_blksize(md, card); - if (err) - goto out; - string_get_size((u64)get_capacity(md->disk) << 9, STRING_UNITS_2, cap_str, sizeof(cap_str)); pr_info("%s: %s %s %s %s\n", @@ -1810,7 +1787,7 @@ static int mmc_blk_probe(struct mmc_card *card) out: mmc_blk_remove_parts(card, md); mmc_blk_remove_req(md); - return err; + return 0; } static void mmc_blk_remove(struct mmc_card *card) @@ -1846,8 +1823,6 @@ static int mmc_blk_resume(struct mmc_card *card) struct mmc_blk_data *md = mmc_get_drvdata(card); if (md) { - mmc_blk_set_blksize(md, card); - /* * Resume involves the card going into idle state, * so current partition is always the main one.