kni: fix build with kernel < 2.6.34
authorIvan Boule <ivan.boule@6wind.com>
Wed, 23 Jan 2013 13:22:14 +0000 (14:22 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 25 Jul 2013 14:07:51 +0000 (16:07 +0200)
Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c

index 8f13ba4..bb87451 100644 (file)
@@ -190,11 +190,25 @@ static int igb_runtime_resume(struct device *dev);
 static int igb_runtime_idle(struct device *dev);
 #endif /* CONFIG_PM_RUNTIME */
 static const struct dev_pm_ops igb_pm_ops = {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+       .suspend = igb_suspend,
+       .resume = igb_resume,
+       .freeze = igb_suspend,
+       .thaw = igb_resume,
+       .poweroff = igb_suspend,
+       .restore = igb_resume,
+#ifdef CONFIG_PM_RUNTIME
+       .runtime_suspend = igb_runtime_suspend,
+       .runtime_resume = igb_runtime_resume,
+       .runtime_idle = igb_runtime_idle,
+#endif
+#else /* Linux >= 2.6.34 */
        SET_SYSTEM_SLEEP_PM_OPS(igb_suspend, igb_resume)
 #ifdef CONFIG_PM_RUNTIME
        SET_RUNTIME_PM_OPS(igb_runtime_suspend, igb_runtime_resume,
                        igb_runtime_idle)
 #endif /* CONFIG_PM_RUNTIME */
+#endif /* Linux version */
 };
 #endif /* HAVE_SYSTEM_SLEEP_PM_OPS */
 #endif /* CONFIG_PM */