Advertisement
Guest User

Untitled

a guest
May 21st, 2013
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
  2. static const SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume)
  3. #endif
  4.  
  5. #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
  6. compat_pci_suspend(rtl_pci_suspend)
  7. compat_pci_resume(rtl_pci_resume)
  8. #endif
  9.  
  10. static struct pci_driver rtl92ce_driver = {
  11.     .name = KBUILD_MODNAME,
  12.     .id_table = rtl92ce_pci_ids,
  13.     .probe = rtl_pci_probe,
  14.     .remove = rtl_pci_disconnect,
  15.  
  16. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
  17.     .driver.pm = &rtlwifi_pm_ops,
  18. #elif defined(CONFIG_PM)
  19.     .suspend = rtl_pci_suspend_compat,
  20.     .resume = rtl_pci_resume_compat,
  21. #endif
  22.  
  23. };
  24.  
  25. static int __init rtl92ce_module_init(void)
  26. {
  27.     int ret;
  28.  
  29.     ret = pci_register_driver(&rtl92ce_driver);
  30.     if (ret)
  31.         RT_ASSERT(false, (": No device found\n"));
  32.  
  33.     return ret;
  34. }
  35.  
  36. static void __exit rtl92ce_module_exit(void)
  37. {
  38.     pci_unregister_driver(&rtl92ce_driver);
  39. }
  40.  
  41. module_init(rtl92ce_module_init);
  42. module_exit(rtl92ce_module_exit);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement