diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2007-05-14 11:27:29 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-05-14 12:51:43 -0400 |
commit | fe6b4c8840c5e23fe9b8696450cee8f2e8cebffd (patch) | |
tree | b5812c0950da7c1a32c3f098874aa26b2d4062e5 | |
parent | 6ba736a10e4ae63b38ccfee9f22b3263a6e5d050 (diff) |
mmc: use assigned major for block device
The MMC block devices now have an assigned major. Make sure
we actually use it.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
-rw-r--r-- | drivers/mmc/card/block.c | 17 | ||||
-rw-r--r-- | include/linux/major.h | 2 |
2 files changed, 6 insertions, 13 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index d24ab234394c..a7562f7fc0b3 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -45,8 +45,6 @@ | |||
45 | */ | 45 | */ |
46 | #define MMC_SHIFT 3 | 46 | #define MMC_SHIFT 3 |
47 | 47 | ||
48 | static int major; | ||
49 | |||
50 | /* | 48 | /* |
51 | * There is one mmc_blk_data per slot. | 49 | * There is one mmc_blk_data per slot. |
52 | */ | 50 | */ |
@@ -466,7 +464,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) | |||
466 | md->queue.issue_fn = mmc_blk_issue_rq; | 464 | md->queue.issue_fn = mmc_blk_issue_rq; |
467 | md->queue.data = md; | 465 | md->queue.data = md; |
468 | 466 | ||
469 | md->disk->major = major; | 467 | md->disk->major = MMC_BLOCK_MAJOR; |
470 | md->disk->first_minor = devidx << MMC_SHIFT; | 468 | md->disk->first_minor = devidx << MMC_SHIFT; |
471 | md->disk->fops = &mmc_bdops; | 469 | md->disk->fops = &mmc_bdops; |
472 | md->disk->private_data = md; | 470 | md->disk->private_data = md; |
@@ -634,14 +632,9 @@ static int __init mmc_blk_init(void) | |||
634 | { | 632 | { |
635 | int res = -ENOMEM; | 633 | int res = -ENOMEM; |
636 | 634 | ||
637 | res = register_blkdev(major, "mmc"); | 635 | res = register_blkdev(MMC_BLOCK_MAJOR, "mmc"); |
638 | if (res < 0) { | 636 | if (res) |
639 | printk(KERN_WARNING "Unable to get major %d for MMC media: %d\n", | ||
640 | major, res); | ||
641 | goto out; | 637 | goto out; |
642 | } | ||
643 | if (major == 0) | ||
644 | major = res; | ||
645 | 638 | ||
646 | return mmc_register_driver(&mmc_driver); | 639 | return mmc_register_driver(&mmc_driver); |
647 | 640 | ||
@@ -652,7 +645,7 @@ static int __init mmc_blk_init(void) | |||
652 | static void __exit mmc_blk_exit(void) | 645 | static void __exit mmc_blk_exit(void) |
653 | { | 646 | { |
654 | mmc_unregister_driver(&mmc_driver); | 647 | mmc_unregister_driver(&mmc_driver); |
655 | unregister_blkdev(major, "mmc"); | 648 | unregister_blkdev(MMC_BLOCK_MAJOR, "mmc"); |
656 | } | 649 | } |
657 | 650 | ||
658 | module_init(mmc_blk_init); | 651 | module_init(mmc_blk_init); |
@@ -661,5 +654,3 @@ module_exit(mmc_blk_exit); | |||
661 | MODULE_LICENSE("GPL"); | 654 | MODULE_LICENSE("GPL"); |
662 | MODULE_DESCRIPTION("Multimedia Card (MMC) block device driver"); | 655 | MODULE_DESCRIPTION("Multimedia Card (MMC) block device driver"); |
663 | 656 | ||
664 | module_param(major, int, 0444); | ||
665 | MODULE_PARM_DESC(major, "specify the major device number for MMC block driver"); | ||
diff --git a/include/linux/major.h b/include/linux/major.h index 0a74c52924c9..7e7c9093919a 100644 --- a/include/linux/major.h +++ b/include/linux/major.h | |||
@@ -152,6 +152,8 @@ | |||
152 | #define USB_ACM_AUX_MAJOR 167 | 152 | #define USB_ACM_AUX_MAJOR 167 |
153 | #define USB_CHAR_MAJOR 180 | 153 | #define USB_CHAR_MAJOR 180 |
154 | 154 | ||
155 | #define MMC_BLOCK_MAJOR 179 | ||
156 | |||
155 | #define VXVM_MAJOR 199 /* VERITAS volume i/o driver */ | 157 | #define VXVM_MAJOR 199 /* VERITAS volume i/o driver */ |
156 | #define VXSPEC_MAJOR 200 /* VERITAS volume config driver */ | 158 | #define VXSPEC_MAJOR 200 /* VERITAS volume config driver */ |
157 | #define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */ | 159 | #define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */ |