Commit fe6b4c88 authored by Pierre Ossman's avatar Pierre Ossman

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: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 6ba736a1
...@@ -45,8 +45,6 @@ ...@@ -45,8 +45,6 @@
*/ */
#define MMC_SHIFT 3 #define MMC_SHIFT 3
static int major;
/* /*
* There is one mmc_blk_data per slot. * There is one mmc_blk_data per slot.
*/ */
...@@ -466,7 +464,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) ...@@ -466,7 +464,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
md->queue.issue_fn = mmc_blk_issue_rq; md->queue.issue_fn = mmc_blk_issue_rq;
md->queue.data = md; md->queue.data = md;
md->disk->major = major; md->disk->major = MMC_BLOCK_MAJOR;
md->disk->first_minor = devidx << MMC_SHIFT; md->disk->first_minor = devidx << MMC_SHIFT;
md->disk->fops = &mmc_bdops; md->disk->fops = &mmc_bdops;
md->disk->private_data = md; md->disk->private_data = md;
...@@ -634,14 +632,9 @@ static int __init mmc_blk_init(void) ...@@ -634,14 +632,9 @@ static int __init mmc_blk_init(void)
{ {
int res = -ENOMEM; int res = -ENOMEM;
res = register_blkdev(major, "mmc"); res = register_blkdev(MMC_BLOCK_MAJOR, "mmc");
if (res < 0) { if (res)
printk(KERN_WARNING "Unable to get major %d for MMC media: %d\n",
major, res);
goto out; goto out;
}
if (major == 0)
major = res;
return mmc_register_driver(&mmc_driver); return mmc_register_driver(&mmc_driver);
...@@ -652,7 +645,7 @@ static int __init mmc_blk_init(void) ...@@ -652,7 +645,7 @@ static int __init mmc_blk_init(void)
static void __exit mmc_blk_exit(void) static void __exit mmc_blk_exit(void)
{ {
mmc_unregister_driver(&mmc_driver); mmc_unregister_driver(&mmc_driver);
unregister_blkdev(major, "mmc"); unregister_blkdev(MMC_BLOCK_MAJOR, "mmc");
} }
module_init(mmc_blk_init); module_init(mmc_blk_init);
...@@ -661,5 +654,3 @@ module_exit(mmc_blk_exit); ...@@ -661,5 +654,3 @@ module_exit(mmc_blk_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Multimedia Card (MMC) block device driver"); 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");
...@@ -152,6 +152,8 @@ ...@@ -152,6 +152,8 @@
#define USB_ACM_AUX_MAJOR 167 #define USB_ACM_AUX_MAJOR 167
#define USB_CHAR_MAJOR 180 #define USB_CHAR_MAJOR 180
#define MMC_BLOCK_MAJOR 179
#define VXVM_MAJOR 199 /* VERITAS volume i/o driver */ #define VXVM_MAJOR 199 /* VERITAS volume i/o driver */
#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */ #define VXSPEC_MAJOR 200 /* VERITAS volume config driver */
#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */ #define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment