MGS-3705-1 [#imx-939] fix gpu build for 4.14 linux kernel
authorYuchou Gan <yuchou.gan@nxp.com>
Fri, 2 Mar 2018 09:58:29 +0000 (17:58 +0800)
committerXianzhong <xianzhong.li@nxp.com>
Sun, 6 May 2018 12:21:49 +0000 (20:21 +0800)
"DRIVER_ATTR" no longer supported in 4.14 linux kernel,
using "DRIVER_ATTR_RW" to replace it.

Signed-off-by: Yuchou Gan <yuchou.gan@nxp.com>
(cherry picked from commit cee4766bd6dc3d48e95578098ef981ec67af8153)

drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c

index cad3e87..0bc059c 100644 (file)
@@ -317,7 +317,7 @@ static struct notifier_block thermal_hot_pm_notifier =
     .notifier_call = thermal_hot_pm_notify,
 };
 
-static ssize_t show_gpu3DMinClock(struct device_driver *dev, char *buf)
+static ssize_t gpu3DMinClock_show(struct device_driver *dev, char *buf)
 {
     gctUINT currentf,minf,maxf;
     gckGALDEVICE galDevice;
@@ -335,7 +335,7 @@ static ssize_t show_gpu3DMinClock(struct device_driver *dev, char *buf)
     return strlen(buf);
 }
 
-static ssize_t update_gpu3DMinClock(struct device_driver *dev, const char *buf, size_t count)
+static ssize_t gpu3DMinClock_store(struct device_driver *dev, const char *buf, size_t count)
 {
 
     gctINT fields;
@@ -357,7 +357,7 @@ static ssize_t update_gpu3DMinClock(struct device_driver *dev, const char *buf,
     return count;
 }
 
-static DRIVER_ATTR(gpu3DMinClock, S_IRUGO | S_IWUSR, show_gpu3DMinClock, update_gpu3DMinClock);
+static DRIVER_ATTR_RW(gpu3DMinClock);
 #endif
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
@@ -421,7 +421,7 @@ struct imx_priv
 static struct imx_priv imxPriv;
 
 #if defined(CONFIG_PM_OPP)
-static ssize_t show_gpuMode(struct device_driver *dev, char *buf)
+static ssize_t gpu_mode_show(struct device_driver *dev, char *buf)
 {
     struct imx_priv *priv = &imxPriv;
     char buffer[512];
@@ -470,7 +470,7 @@ static ssize_t show_gpuMode(struct device_driver *dev, char *buf)
     return strlen(buf);
 }
 
-static ssize_t update_gpuMode(struct device_driver *dev, const char *buf, size_t count)
+static ssize_t gpu_mode_store(struct device_driver *dev, const char *buf, size_t count)
 {
     unsigned long core_freq = 0;
     unsigned long shader_freq = 0;
@@ -515,7 +515,7 @@ static ssize_t update_gpuMode(struct device_driver *dev, const char *buf, size_t
     return count;
 }
 
-static DRIVER_ATTR(gpu_mode, S_IRUGO | S_IWUSR, show_gpuMode, update_gpuMode);
+static DRIVER_ATTR_RW(gpu_mode);
 
 int init_gpu_opp_table(struct device *dev)
 {