From patchwork Wed Dec 14 15:06:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 5699 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 4D83E23E21 for ; Wed, 14 Dec 2011 15:07:07 +0000 (UTC) Received: from mail-lpp01m010-f52.google.com (mail-lpp01m010-f52.google.com [209.85.215.52]) by fiordland.canonical.com (Postfix) with ESMTP id 2BBFEA1808F for ; Wed, 14 Dec 2011 15:07:07 +0000 (UTC) Received: by lahj13 with SMTP id j13so512140lah.11 for ; Wed, 14 Dec 2011 07:07:06 -0800 (PST) Received: by 10.204.156.208 with SMTP id y16mr1134975bkw.72.1323875226608; Wed, 14 Dec 2011 07:07:06 -0800 (PST) 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.205.129.2 with SMTP id hg2cs11243bkc; Wed, 14 Dec 2011 07:07:06 -0800 (PST) Received: by 10.14.17.18 with SMTP id i18mr1624419eei.11.1323875224386; Wed, 14 Dec 2011 07:07:04 -0800 (PST) Received: from eu1sys200aog113.obsmtp.com (eu1sys200aog113.obsmtp.com. [207.126.144.135]) by mx.google.com with SMTP id m54si2152226eef.187.2011.12.14.07.07.00 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Dec 2011 07:07:04 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.135 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.135; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.135 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 eu1sys200aob113.postini.com ([207.126.147.11]) with SMTP ID DSNKTui7eQznOdYylU9EtTZ6ltsPzQ4R/07j@postini.com; Wed, 14 Dec 2011 15:07:04 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 206A4AF; Wed, 14 Dec 2011 14:58:03 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 6C312CE9; Wed, 14 Dec 2011 15:06:29 +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 D4908A8072; Wed, 14 Dec 2011 16:06:22 +0100 (CET) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 14 Dec 2011 16:06:28 +0100 From: Ulf Hansson To: , Chris Ball Cc: Per Forlin , Ulf Hansson , Johan Rudholm , Lee Jones Subject: [PATCH V2 1/2] mmc: block: Remove use of mmc_blk_set_blksize Date: Wed, 14 Dec 2011 16:06:09 +0100 Message-ID: <1323875170-7103-2-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1323875170-7103-1-git-send-email-ulf.hansson@stericsson.com> References: <1323875170-7103-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 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 Reviewed-by: Stefan Nilsson XK --- Changes in v2: - Rebased patch on latest version of mmc-next --- 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 0c959c9..4b62d1f 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1598,24 +1598,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; @@ -1742,7 +1724,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]; /* @@ -1755,10 +1736,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", @@ -1783,7 +1760,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) @@ -1819,8 +1796,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.