From patchwork Fri Jan 29 21:00:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 44033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 17969B7CC1 for ; Sat, 30 Jan 2010 08:02:09 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1Naxws-0000ZG-0h; Fri, 29 Jan 2010 21:00:14 +0000 Received: from exchange.solarflare.com ([216.237.3.220]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1Naxwl-0000UP-GF for linux-mtd@lists.infradead.org; Fri, 29 Jan 2010 21:00:12 +0000 Received: from [10.17.20.50] ([10.17.20.50]) by exchange.solarflare.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 29 Jan 2010 13:00:34 -0800 Subject: [PATCHv3 9/9] mtdchar: Register the full range of minor numbers From: Ben Hutchings To: David Woodhouse In-Reply-To: <1264798537.2785.25.camel@achroite.uk.solarflarecom.com> References: <1264798537.2785.25.camel@achroite.uk.solarflarecom.com> Organization: Solarflare Communications Date: Fri, 29 Jan 2010 21:00:04 +0000 Message-Id: <1264798804.2785.42.camel@achroite.uk.solarflarecom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) X-OriginalArrivalTime: 29 Jan 2010 21:00:35.0320 (UTC) FILETIME=[1A28EF80:01CAA126] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.000.1038-17160.005 X-TM-AS-Result: No--17.183000-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100129_160007_639543_588A2867 X-CRM114-Status: GOOD ( 12.16 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- _SUMMARY_ Cc: linux-net-drivers@solarflare.com, linux-mtd@lists.infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org register_chrdev() registers minor numbers up to 255, but we can now potentially have much larger numbers. Signed-off-by: Ben Hutchings --- drivers/mtd/mtdchar.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 04fd7e5..09b0ab5 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c @@ -955,7 +955,8 @@ static int __init init_mtdchar(void) { int status; - status = register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops); + status = __register_chrdev(MTD_CHAR_MAJOR, 0, 1 << MINORBITS, + "mtd", &mtd_fops); if (status < 0) { printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n", MTD_CHAR_MAJOR); @@ -966,7 +967,7 @@ static int __init init_mtdchar(void) static void __exit cleanup_mtdchar(void) { - unregister_chrdev(MTD_CHAR_MAJOR, "mtd"); + __unregister_chrdev(MTD_CHAR_MAJOR, 0, 1 << MINORBITS, "mtd"); } module_init(init_mtdchar);