VirtualBox

Ignore:
Timestamp:
Aug 3, 2009 6:42:45 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50637
Message:

Linux host kernel module: adapted platform power management interface to Linux >= 2.6.30

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r21682 r21949  
    181181#ifdef VBOX_WITH_SUSPEND_NOTIFICATION
    182182static int  VBoxDrvProbe(struct platform_device *pDev);
     183# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
     184static int  VBoxDrvSuspend(struct device *pDev);
     185static int  VBoxDrvResume(struct device *pDev);
     186# else
    183187static int  VBoxDrvSuspend(struct platform_device *pDev, pm_message_t State);
    184188static int  VBoxDrvResume(struct platform_device *pDev);
     189# endif
    185190static void VBoxDevRelease(struct device *pDev);
    186191#endif
     
    214219
    215220#ifdef VBOX_WITH_SUSPEND_NOTIFICATION
    216 static struct platform_driver gPlatformDriver =
    217 {
    218     .probe = VBoxDrvProbe,
     221# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
     222static struct dev_pm_ops gPlatformPMOps =
     223{
    219224    .suspend = VBoxDrvSuspend,
    220225    .resume = VBoxDrvResume,
     226};
     227# endif
     228
     229static struct platform_driver gPlatformDriver =
     230{
     231    .probe = VBoxDrvProbe,
     232# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
     233    .suspend = VBoxDrvSuspend,
     234    .resume = VBoxDrvResume,
     235# endif
    221236    /** @todo .shutdown? */
    222237    .driver =
    223238    {
    224         .name = "vboxdrv"
     239        .name = "vboxdrv",
     240# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
     241        .pm = &gPlatformPMOps,
     242# endif
    225243    }
    226244};
     
    735753 * @param   State       message type, see Documentation/power/devices.txt.
    736754 */
     755# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
     756static int VBoxDrvSuspend(struct device *pDev)
     757# else
    737758static int VBoxDrvSuspend(struct platform_device *pDev, pm_message_t State)
     759# endif
    738760{
    739761    RTPowerSignalEvent(RTPOWEREVENT_SUSPEND);
     
    746768 * @param   pDev        Pointer to the platform device.
    747769 */
     770# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
     771static int VBoxDrvResume(struct device *pDev)
     772# else
    748773static int VBoxDrvResume(struct platform_device *pDev)
     774# endif
    749775{
    750776    RTPowerSignalEvent(RTPOWEREVENT_RESUME);
Note: See TracChangeset for help on using the changeset viewer.

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