aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid/megaraid_mm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_mm.c')
-rw-r--r--drivers/scsi/megaraid/megaraid_mm.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c
index b6587a6d8486..0ad215e27b83 100644
--- a/drivers/scsi/megaraid/megaraid_mm.c
+++ b/drivers/scsi/megaraid/megaraid_mm.c
@@ -59,7 +59,6 @@ EXPORT_SYMBOL(mraid_mm_register_adp);
59EXPORT_SYMBOL(mraid_mm_unregister_adp); 59EXPORT_SYMBOL(mraid_mm_unregister_adp);
60EXPORT_SYMBOL(mraid_mm_adapter_app_handle); 60EXPORT_SYMBOL(mraid_mm_adapter_app_handle);
61 61
62static int majorno;
63static uint32_t drvr_ver = 0x02200207; 62static uint32_t drvr_ver = 0x02200207;
64 63
65static int adapters_count_g; 64static int adapters_count_g;
@@ -76,6 +75,12 @@ static const struct file_operations lsi_fops = {
76 .owner = THIS_MODULE, 75 .owner = THIS_MODULE,
77}; 76};
78 77
78static struct miscdevice megaraid_mm_dev = {
79 .minor = MISC_DYNAMIC_MINOR,
80 .name = "megadev0",
81 .fops = &lsi_fops,
82};
83
79/** 84/**
80 * mraid_mm_open - open routine for char node interface 85 * mraid_mm_open - open routine for char node interface
81 * @inode : unused 86 * @inode : unused
@@ -1184,15 +1189,16 @@ mraid_mm_teardown_dma_pools(mraid_mmadp_t *adp)
1184static int __init 1189static int __init
1185mraid_mm_init(void) 1190mraid_mm_init(void)
1186{ 1191{
1192 int err;
1193
1187 // Announce the driver version 1194 // Announce the driver version
1188 con_log(CL_ANN, (KERN_INFO "megaraid cmm: %s %s\n", 1195 con_log(CL_ANN, (KERN_INFO "megaraid cmm: %s %s\n",
1189 LSI_COMMON_MOD_VERSION, LSI_COMMON_MOD_EXT_VERSION)); 1196 LSI_COMMON_MOD_VERSION, LSI_COMMON_MOD_EXT_VERSION));
1190 1197
1191 majorno = register_chrdev(0, "megadev", &lsi_fops); 1198 err = misc_register(&megaraid_mm_dev);
1192 1199 if (err < 0) {
1193 if (majorno < 0) { 1200 con_log(CL_ANN, ("megaraid cmm: cannot register misc device\n"));
1194 con_log(CL_ANN, ("megaraid cmm: cannot get major\n")); 1201 return err;
1195 return majorno;
1196 } 1202 }
1197 1203
1198 init_waitqueue_head(&wait_q); 1204 init_waitqueue_head(&wait_q);
@@ -1230,7 +1236,7 @@ mraid_mm_exit(void)
1230{ 1236{
1231 con_log(CL_DLEVEL1 , ("exiting common mod\n")); 1237 con_log(CL_DLEVEL1 , ("exiting common mod\n"));
1232 1238
1233 unregister_chrdev(majorno, "megadev"); 1239 misc_deregister(&megaraid_mm_dev);
1234} 1240}
1235 1241
1236module_init(mraid_mm_init); 1242module_init(mraid_mm_init);