mtdchar: Register the full range of minor numbers

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Feb 25 07:59:05 EST 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=dad0db318b391ddb9845ac5e52044f921219bf69
Commit:     dad0db318b391ddb9845ac5e52044f921219bf69
Parent:     4d3a8534bdbcf4843fc8ad05c9a81a964fc65237
Author:     Ben Hutchings <bhutchings at solarflare.com>
AuthorDate: Fri Jan 29 21:00:04 2010 +0000
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Thu Feb 25 12:46:04 2010 +0000

    mtdchar: Register the full range of minor numbers
    
    register_chrdev() registers minor numbers up to 255, but we can now
    potentially have much larger numbers.
    
    Signed-off-by: Ben Hutchings <bhutchings at solarflare.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 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 9f826cd..c355491 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);



More information about the linux-mtd-cvs mailing list