- Timestamp:
- Sep 10, 2014 4:01:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
r48447 r52681 129 129 static char g_szDbgLogDst[128]; 130 130 # endif 131 #endif132 133 /** Our file node major id.134 * Either set dynamically at run time or statically at compile time. */135 #ifdef CONFIG_VBOXGUEST_MAJOR136 static unsigned int g_iModuleMajor = CONFIG_VBOXGUEST_MAJOR;137 #else138 static unsigned int g_iModuleMajor = 0;139 #endif140 #ifdef CONFIG_VBOXADD_MAJOR141 # error "CONFIG_VBOXADD_MAJOR -> CONFIG_VBOXGUEST_MAJOR"142 131 #endif 143 132 … … 504 493 * The full feature device node. 505 494 */ 506 if (g_iModuleMajor > 0) 507 { 508 rc = register_chrdev(g_iModuleMajor, DEVICE_NAME, &g_FileOps); 509 if (rc < 0) 510 { 511 LogRel((DEVICE_NAME ": register_chrdev failed: g_iModuleMajor: %d, rc: %d\n", g_iModuleMajor, rc)); 512 return rc; 513 } 514 } 515 else 516 { 517 rc = misc_register(&g_MiscDevice); 518 if (rc) 519 { 520 LogRel((DEVICE_NAME ": misc_register failed for %s (rc=%d)\n", DEVICE_NAME, rc)); 521 return rc; 522 } 495 rc = misc_register(&g_MiscDevice); 496 if (rc) 497 { 498 LogRel((DEVICE_NAME ": misc_register failed for %s (rc=%d)\n", DEVICE_NAME, rc)); 499 return rc; 523 500 } 524 501 … … 530 507 { 531 508 LogRel((DEVICE_NAME ": misc_register failed for %s (rc=%d)\n", DEVICE_NAME_USER, rc)); 532 if (g_iModuleMajor > 0) 533 unregister_chrdev(g_iModuleMajor, DEVICE_NAME); 534 else 535 misc_deregister(&g_MiscDevice); 509 misc_deregister(&g_MiscDevice); 536 510 return rc; 537 511 } … … 546 520 static void vboxguestLinuxTermDeviceNodes(void) 547 521 { 548 if (g_iModuleMajor > 0) 549 unregister_chrdev(g_iModuleMajor, DEVICE_NAME); 550 else 551 misc_deregister(&g_MiscDevice); 522 misc_deregister(&g_MiscDevice); 552 523 misc_deregister(&g_MiscDeviceUser); 553 524 } … … 653 624 { 654 625 /* some useful information for the user but don't show this on the console */ 655 LogRel((DEVICE_NAME ": m ajor %d, IRQ %d, I/O port %RTiop, MMIO at %RHp (size 0x%x)\n",656 g_ iModuleMajor, g_pPciDev->irq, g_IOPortBase, g_MMIOPhysAddr, g_cbMMIO));626 LogRel((DEVICE_NAME ": misc device minor %d, IRQ %d, I/O port %RTiop, MMIO at %RHp (size 0x%x)\n", 627 g_MiscDevice.minor, g_pPciDev->irq, g_IOPortBase, g_MMIOPhysAddr, g_cbMMIO)); 657 628 printk(KERN_DEBUG DEVICE_NAME ": Successfully loaded version " 658 629 VBOX_VERSION_STRING " (interface " RT_XSTR(VMMDEV_VERSION) ")\n");
Note:
See TracChangeset
for help on using the changeset viewer.