VirtualBox

Ignore:
Timestamp:
Sep 10, 2014 4:01:06 PM (10 years ago)
Author:
vboxsync
Message:

Additions/common/VBoxGuest: Linux: remove unused code for creating a device major.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c

    r48447 r52681  
    129129static char                     g_szDbgLogDst[128];
    130130# endif
    131 #endif
    132 
    133 /** Our file node major id.
    134  * Either set dynamically at run time or statically at compile time. */
    135 #ifdef CONFIG_VBOXGUEST_MAJOR
    136 static unsigned int             g_iModuleMajor = CONFIG_VBOXGUEST_MAJOR;
    137 #else
    138 static unsigned int             g_iModuleMajor = 0;
    139 #endif
    140 #ifdef CONFIG_VBOXADD_MAJOR
    141 # error "CONFIG_VBOXADD_MAJOR -> CONFIG_VBOXGUEST_MAJOR"
    142131#endif
    143132
     
    504493     * The full feature device node.
    505494     */
    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;
    523500    }
    524501
     
    530507    {
    531508        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);
    536510        return rc;
    537511    }
     
    546520static void vboxguestLinuxTermDeviceNodes(void)
    547521{
    548     if (g_iModuleMajor > 0)
    549         unregister_chrdev(g_iModuleMajor, DEVICE_NAME);
    550     else
    551         misc_deregister(&g_MiscDevice);
     522    misc_deregister(&g_MiscDevice);
    552523    misc_deregister(&g_MiscDeviceUser);
    553524}
     
    653624                        {
    654625                            /* some useful information for the user but don't show this on the console */
    655                             LogRel((DEVICE_NAME ": major %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));
    657628                            printk(KERN_DEBUG DEVICE_NAME ": Successfully loaded version "
    658629                                   VBOX_VERSION_STRING " (interface " RT_XSTR(VMMDEV_VERSION) ")\n");
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette