Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@flint.arm.linux.org.uk>2004-09-29 17:28:30 +0100
committerRussell King <rmk@flint.arm.linux.org.uk>2004-09-29 17:28:30 +0100
commit0931f8a984b0e0db09ca3f75c9d5dedbf334f514 (patch)
treed473d937f93a86bdf29ffe389fa36843811bdce3
parentb3004915274bedc5f6fc4d9cc0ca6f0f248e8f38 (diff)
[MMC] Provide major= module parameter for mmc_block
This allows users to provide a fixed major number - early 2.4 MMC drivers used block device major 60, which is "local/experimental use"
-rw-r--r--drivers/mmc/mmc_block.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c
index dc095d7fd749..f76673a47542 100644
--- a/drivers/mmc/mmc_block.c
+++ b/drivers/mmc/mmc_block.c
@@ -42,7 +42,7 @@
*/
#define MMC_SHIFT 3
-static int mmc_major;
+static int major;
/*
* There is one mmc_blk_data per slot.
@@ -323,7 +323,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
md->queue.issue_fn = mmc_blk_issue_rq;
md->queue.data = md;
- md->disk->major = mmc_major;
+ md->disk->major = major;
md->disk->first_minor = devidx << MMC_SHIFT;
md->disk->fops = &mmc_bdops;
md->disk->private_data = md;
@@ -462,14 +462,14 @@ static int __init mmc_blk_init(void)
{
int res = -ENOMEM;
- res = register_blkdev(mmc_major, "mmc");
+ res = register_blkdev(major, "mmc");
if (res < 0) {
printk(KERN_WARNING "Unable to get major %d for MMC media: %d\n",
- mmc_major, res);
+ major, res);
goto out;
}
- if (mmc_major == 0)
- mmc_major = res;
+ if (major == 0)
+ major = res;
devfs_mk_dir("mmc");
return mmc_register_driver(&mmc_driver);
@@ -482,7 +482,7 @@ static void __exit mmc_blk_exit(void)
{
mmc_unregister_driver(&mmc_driver);
devfs_remove("mmc");
- unregister_blkdev(mmc_major, "mmc");
+ unregister_blkdev(major, "mmc");
}
module_init(mmc_blk_init);
@@ -490,3 +490,6 @@ module_exit(mmc_blk_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Multimedia Card (MMC) block device driver");
+
+module_param(major, int, 0444);
+MODULE_PARM_DESC(major, "specify the major device number for MMC block driver");