compat-wireless: add pm ops backport for p54
authorLuis R. Rodriguez <mcgrof@frijolero.org>
Sun, 1 Apr 2012 03:31:06 +0000 (20:31 -0700)
committerLuis R. Rodriguez <mcgrof@frijolero.org>
Sun, 1 Apr 2012 03:31:06 +0000 (20:31 -0700)
This should fix compiling on 2.6.28.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
patches/11-dev-pm-ops.patch

index 5858391fb68b69a06243661bef76984a11bf6bdb..699318527bcf74022f557ed8e01c676572026560 100644 (file)
@@ -367,3 +367,37 @@ calls on compat code with only slight modifications.
  };
  
  static int __init rtl92se_module_init(void)
+--- a/drivers/net/wireless/p54/p54pci.c
++++ b/drivers/net/wireless/p54/p54pci.c
+@@ -645,14 +645,10 @@ static int p54p_resume(struct device *de
+       return pci_set_power_state(pdev, PCI_D0);
+ }
+-static const struct dev_pm_ops p54pci_pm_ops = {
+-      .suspend = p54p_suspend,
+-      .resume = p54p_resume,
+-      .freeze = p54p_suspend,
+-      .thaw = p54p_resume,
+-      .poweroff = p54p_suspend,
+-      .restore = p54p_resume,
+-};
++compat_pci_suspend(p54p_suspend)
++compat_pci_resume(p54p_resume)
++
++static SIMPLE_DEV_PM_OPS(p54_pm_ops, p54_suspend, p54_resume);
+ #define P54P_PM_OPS (&p54pci_pm_ops)
+ #else
+@@ -664,7 +660,12 @@ static struct pci_driver p54p_driver = {
+       .id_table       = p54p_table,
+       .probe          = p54p_probe,
+       .remove         = __devexit_p(p54p_remove),
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+       .driver.pm      = P54P_PM_OPS,
++#elif defined(CONFIG_PM)
++      .suspend    = p54_suspend_compat,
++      .resume     = p54_resume_compat,
++#endif
+ };
+ static int __init p54p_init(void)