]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
gpu: vivante: fix build errors with CONFIG_PM_SLEEP/CONFIG_PM_RUNTIME disabled
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 26 Feb 2015 08:55:10 +0000 (09:55 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 26 Feb 2015 08:55:10 +0000 (09:55 +0100)
drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c

index b31d06e6af431c32a4f47b87284df63766968cdc..e3eca97bc3f23204c1ea2213ca03f45045029280 100644 (file)
@@ -604,7 +604,12 @@ _SetPower(
     IN gctBOOL Enable
     )
 {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) ||             \
+       (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) &&        \
+               LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))) ||        \
+       defined(CONFIG_PM)
     struct imx_priv* priv = Platform->priv;
+#endif
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
     int ret;
@@ -764,7 +769,7 @@ _SetClock(
 }
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_RUNTIME
 static int gpu_runtime_suspend(struct device *dev)
 {
     return 0;
@@ -774,7 +779,9 @@ static int gpu_runtime_resume(struct device *dev)
 {
     return 0;
 }
+#endif
 
+#ifdef CONFIG_PM
 static struct dev_pm_ops gpu_pm_ops;
 #endif
 #endif
@@ -795,6 +802,7 @@ _AdjustDriver(
     /* Override PM callbacks to add runtime PM callbacks. */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
     /* Fill local structure with original value. */
+#ifdef CONFIG_PM
     memcpy(&gpu_pm_ops, driver->driver.pm, sizeof(struct dev_pm_ops));
 
     /* Add runtime PM callback. */
@@ -806,6 +814,7 @@ _AdjustDriver(
 
     /* Replace callbacks. */
     driver->driver.pm = &gpu_pm_ops;
+#endif
 #endif
     return gcvSTATUS_OK;
 }