Skip to contentSkip to conversation

memstick: don't allocate unused major for ms_block

PATCH New [email protected] 1 participant 1 message Aug 2, 2016 Sony memorystick

lore
Share & tools
lore
#0 lore raw

PATCH 29/111 memstick: don't allocate unused major for ms_block

From: NeilBrown <[email protected]>
Subject: memstick: don't allocate unused major for ms_block

When alloc_disk(0) is used the ->major number is completely ignored. All devices are allocated with a major of BLOCK_EXT_MAJOR.

So remove registration and deregistration of 'major'.

---

 drivers/memstick/core/ms_block.c |   17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)
drivers/memstick/core/ms_block.c renamed from drivers/memstick/core/ms_block.c~memstick-dont-allocate-unused-major-for-ms_block +0 -8
diff -puN drivers/memstick/core/ms_block.c~memstick-dont-allocate-unused-major-for-ms_block drivers/memstick/core/ms_block.c
@@ -2338,23 +2338,11 @@ static struct memstick_driver msb_driver
 	.resume   = msb_resume
 };
 
-static int major;
-
 static int __init msb_init(void)
 {
-	int rc = register_blkdev(0, DRIVER_NAME);
-
-	if (rc < 0) {
-		pr_err("failed to register major (error %d)\n", rc);
-		return rc;
-	}