From patchwork Tue Sep 20 11:08:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Girish K S X-Patchwork-Id: 4199 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 0435B23EFB for ; Tue, 20 Sep 2011 11:09:04 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id E6FD7A18056 for ; Tue, 20 Sep 2011 11:09:03 +0000 (UTC) Received: by fxe23 with SMTP id 23so556707fxe.11 for ; Tue, 20 Sep 2011 04:09:03 -0700 (PDT) Received: by 10.223.55.136 with SMTP id u8mr1146123fag.46.1316516943724; Tue, 20 Sep 2011 04:09:03 -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.152.18.198 with SMTP id y6cs75756lad; Tue, 20 Sep 2011 04:09:03 -0700 (PDT) Received: by 10.101.88.10 with SMTP id q10mr572126anl.35.1316516942272; Tue, 20 Sep 2011 04:09:02 -0700 (PDT) Received: from mail-gw0-f45.google.com (mail-gw0-f45.google.com [74.125.83.45]) by mx.google.com with ESMTPS id t13si521614anj.34.2011.09.20.04.09.01 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Sep 2011 04:09:02 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.45 is neither permitted nor denied by best guess record for domain of girish.shivananjappa@linaro.org) client-ip=74.125.83.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.83.45 is neither permitted nor denied by best guess record for domain of girish.shivananjappa@linaro.org) smtp.mail=girish.shivananjappa@linaro.org Received: by gwb19 with SMTP id 19so372520gwb.18 for ; Tue, 20 Sep 2011 04:09:01 -0700 (PDT) Received: by 10.68.12.35 with SMTP id v3mr6248305pbb.268.1316516941144; Tue, 20 Sep 2011 04:09:01 -0700 (PDT) Received: from girishks ([115.113.119.130]) by mx.google.com with ESMTPS id ji3sm5022132pbc.2.2011.09.20.04.08.57 (version=SSLv3 cipher=OTHER); Tue, 20 Sep 2011 04:09:00 -0700 (PDT) From: Girish K S To: linux-mmc@vger.kernel.org Cc: cjb@laptop.org, kgene.kim@samsung.com, patches@linaro.org, linux-samsung-soc@vger.kernel.org, Girish K S Subject: [PATCH] mmc: card: modify mmc_getgeo function Date: Tue, 20 Sep 2011 16:38:49 +0530 Message-Id: <1316516929-26694-1-git-send-email-girish.shivananjappa@linaro.org> X-Mailer: git-send-email 1.7.1 In the earlier code the cylinder, sector and head are assigned independently. Current patch generates the cylinder number with the values of sector and head. This patch only makes they cylinder value to be dependent on the sector and head. Signed-off-by: Girish K S --- drivers/mmc/card/block.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 1ff5486..bebb13b 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -226,9 +226,10 @@ static int mmc_blk_release(struct gendisk *disk, fmode_t mode) static int mmc_blk_getgeo(struct block_device *bdev, struct hd_geometry *geo) { - geo->cylinders = get_capacity(bdev->bd_disk) / (4 * 16); geo->heads = 4; geo->sectors = 16; + geo->cylinders = get_capacity(bdev->bd_disk) / + (geo->heads * geo->sectors); return 0; }