aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdchar.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-01-29 16:00:04 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-02-25 07:46:04 -0500
commitdad0db318b391ddb9845ac5e52044f921219bf69 (patch)
tree8b0ae649a53bc916ab74e57a47bbcd99804dde11 /drivers/mtd/mtdchar.c
parent4d3a8534bdbcf4843fc8ad05c9a81a964fc65237 (diff)
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@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r--drivers/mtd/mtdchar.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 9f826cda2748..c355491d1326 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -955,7 +955,8 @@ static int __init init_mtdchar(void)
955{ 955{
956 int status; 956 int status;
957 957
958 status = register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops); 958 status = __register_chrdev(MTD_CHAR_MAJOR, 0, 1 << MINORBITS,
959 "mtd", &mtd_fops);
959 if (status < 0) { 960 if (status < 0) {
960 printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n", 961 printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n",
961 MTD_CHAR_MAJOR); 962 MTD_CHAR_MAJOR);
@@ -966,7 +967,7 @@ static int __init init_mtdchar(void)
966 967
967static void __exit cleanup_mtdchar(void) 968static void __exit cleanup_mtdchar(void)
968{ 969{
969 unregister_chrdev(MTD_CHAR_MAJOR, "mtd"); 970 __unregister_chrdev(MTD_CHAR_MAJOR, 0, 1 << MINORBITS, "mtd");
970} 971}
971 972
972module_init(init_mtdchar); 973module_init(init_mtdchar);