diff mbox

+ mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update.patch added to -mm tree

Message ID 201008232258.o7NMwnKE019659@imap1.linux-foundation.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Andrew Morton Aug. 23, 2010, 10:58 p.m. UTC
None
diff mbox

Patch

diff -puN Documentation/devices.txt~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update Documentation/devices.txt
--- a/Documentation/devices.txt~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update
+++ a/Documentation/devices.txt
@@ -2519,6 +2519,12 @@  Your cooperation is appreciated.
 		  8 = /dev/mmcblk1      Second SD/MMC card
 		    ...
 
+		The start of next SD/MMC card can be configured with
+		CONFIG_MMC_BLOCK_MINORS, or overridden at boot/modprobe
+		time using the mmcblk.perdev_minors option. That would
+		bump the offset between each card to be the configured
+		value instead of the default 8.
+
 179 char	CCube DVXChip-based PCI products
 		  0 = /dev/dvxirq0	First DVX device
 		  1 = /dev/dvxirq1	Second DVX device
diff -puN drivers/mmc/card/block.c~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update drivers/mmc/card/block.c
--- a/drivers/mmc/card/block.c~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update
+++ a/drivers/mmc/card/block.c
@@ -60,7 +60,7 @@  static int perdev_minors = CONFIG_MMC_BL
  * We've only got one major, so number of mmcblk devices is
  * limited to 256 / number of minors per device.
  */
-static int max_devices = DIV_ROUND_UP(256, CONFIG_MMC_BLOCK_MINORS);
+static int max_devices;
 
 /* 256 minors, so at most 256 separate devices */
 static DECLARE_BITMAP(dev_use, 256);
@@ -79,7 +79,7 @@  struct mmc_blk_data {
 
 static DEFINE_MUTEX(open_lock);
 
-module_param(perdev_minors, int, 0644);
+module_param(perdev_minors, int, 0444);
 MODULE_PARM_DESC(perdev_minors, "Minors numbers to allocate per device");
 
 static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk)
@@ -782,10 +782,10 @@  static int __init mmc_blk_init(void)
 {
 	int res;
 
-	if (perdev_minors != CONFIG_MMC_BLOCK_MINORS) {
+	if (perdev_minors != CONFIG_MMC_BLOCK_MINORS)
 		pr_info("mmcblk: using %d minors per device\n", perdev_minors);
-		max_devices = DIV_ROUND_UP(256, perdev_minors);
-	}
+
+	max_devices = 256 / perdev_minors;
 
 	res = register_blkdev(MMC_BLOCK_MAJOR, "mmc");
 	if (res)