Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dad0db31 authored by Ben Hutchings's avatar Ben Hutchings Committed by David Woodhouse
Browse files

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: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 4d3a8534
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);