From patchwork Sat Apr 23 01:01:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 1164 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:49:47 -0000 Delivered-To: patches@linaro.org Received: by 10.224.80.148 with SMTP id t20cs36565qak; Fri, 22 Apr 2011 18:01:57 -0700 (PDT) Received: by 10.150.114.18 with SMTP id m18mr1647532ybc.308.1303520516930; Fri, 22 Apr 2011 18:01:56 -0700 (PDT) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.141]) by mx.google.com with ESMTPS id t3si9533004ybe.21.2011.04.22.18.01.54 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Apr 2011 18:01:55 -0700 (PDT) Received-SPF: pass (google.com: domain of jstultz@us.ibm.com designates 32.97.182.141 as permitted sender) client-ip=32.97.182.141; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jstultz@us.ibm.com designates 32.97.182.141 as permitted sender) smtp.mail=jstultz@us.ibm.com Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e1.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p3N0pCFr003084; Fri, 22 Apr 2011 20:51:12 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p3N11stx041400; Fri, 22 Apr 2011 21:01:54 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p3N11rjt010064; Fri, 22 Apr 2011 21:01:53 -0400 Received: from kernel.beaverton.ibm.com (kernel.beaverton.ibm.com [9.47.67.96]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p3N11rSp010058; Fri, 22 Apr 2011 21:01:53 -0400 Received: by kernel.beaverton.ibm.com (Postfix, from userid 1056) id 99BBA1E7510; Fri, 22 Apr 2011 18:01:52 -0700 (PDT) From: John Stultz To: linux-mmc@vger.kernel.org Cc: Colin Cross , Chris Ball , Arnd Bergmann , Dima Zavin , John Stultz Subject: [PATCH 2/6] mmc_block: Allow more than 8 partitions per card Date: Fri, 22 Apr 2011 18:01:38 -0700 Message-Id: <1303520502-32171-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.3.2.146.gca209 In-Reply-To: <1303520502-32171-1-git-send-email-john.stultz@linaro.org> References: <1303520502-32171-1-git-send-email-john.stultz@linaro.org> From: Colin Cross Set the GENHD_FL_EXT_DEVT flag, which will allocate minor numbers in major 259 for partitions past disk->minors. Also remove the use of disk_devt to determine devidx from md->disk. md->disk->first_minor is always initialized from devidx and can always be used to recover it. CC: Chris Ball CC: Arnd Bergmann CC: Dima Zavin Signed-off-by: Colin Cross Signed-off-by: John Stultz --- drivers/mmc/card/block.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index edac9ac..f69f948 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -102,11 +102,7 @@ static void mmc_blk_put(struct mmc_blk_data *md) mutex_lock(&open_lock); md->usage--; if (md->usage == 0) { - int devmaj = MAJOR(disk_devt(md->disk)); - int devidx = MINOR(disk_devt(md->disk)) / perdev_minors; - - if (!devmaj) - devidx = md->disk->first_minor / perdev_minors; + int devidx = md->disk->first_minor / perdev_minors; blk_cleanup_queue(md->queue.queue); @@ -623,6 +619,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) md->disk->private_data = md; md->disk->queue = md->queue.queue; md->disk->driverfs_dev = &card->dev; + md->disk->flags = GENHD_FL_EXT_DEVT; set_disk_ro(md->disk, md->read_only); /*