IPC: Fix merge problems.
authorFei Yang <fei.yang@intel.com>
Mon, 12 Sep 2011 21:54:45 +0000 (14:54 -0700)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:38:02 +0000 (12:38 -0800)
The latest version in 2.6.35 tree is using if-else statement in function
scu_ipc_ioctl, however in AC tree switch-case statement is used instead,
need to add break instruction accordingly.
Also CPU type checking is introduced in 2.6.35 tree, need to merge that
change for INTEL_SCU_IPC_FW_UPDATE.
In Linux 3.0 pm_qos_add_request doesn't allocate memory any more, the
function requires a pre-allocated struct pm_qos_request_list. make change
in intel_scu_ipc_init accordingly.

Change-Id: Ia36a46030f52ad3f68c0c8e9d101bb049460e2ec
Signed-off-by: Fei Yang <fei.yang@intel.com>
drivers/platform/x86/intel_scu_ipc.c
drivers/platform/x86/intel_scu_ipcutil.c

index 8acb89a..186faac 100644 (file)
@@ -1587,8 +1587,12 @@ static int __init intel_scu_ipc_init(void)
        if (platform == 0)
                return -ENODEV;
 
-       qos = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY,
-                                       PM_QOS_DEFAULT_VALUE);
+       qos = kzalloc(sizeof(struct pm_qos_request_list), GFP_KERNEL);
+       if (!qos)
+               return -ENOMEM;
+
+       pm_qos_add_request(qos, PM_QOS_CPU_DMA_LATENCY,
+                               PM_QOS_DEFAULT_VALUE);
 
        return  pci_register_driver(&ipc_driver);
 
index e72704a..4512a48 100644 (file)
@@ -112,15 +112,17 @@ static long scu_ipc_ioctl(struct file *fp, unsigned int cmd,
        switch (cmd) {
        case INTEL_SCU_IPC_FW_UPDATE:
        {
-               u8 *fwbuf = kmalloc(MAX_FW_SIZE, GFP_KERNEL);
-               if (fwbuf == NULL)
-                       return -ENOMEM;
-               if (copy_from_user(fwbuf, (u8 *)arg, MAX_FW_SIZE)) {
+               if (platform == MRST_CPU_CHIP_LINCROFT) {
+                       u8 *fwbuf = kmalloc(MAX_FW_SIZE, GFP_KERNEL);
+                       if (fwbuf == NULL)
+                               return -ENOMEM;
+                       if (copy_from_user(fwbuf, (u8 *)arg, MAX_FW_SIZE)) {
+                               kfree(fwbuf);
+                               return -EFAULT;
+                       }
+                       ret = intel_scu_ipc_mrstfw_update(fwbuf, MAX_FW_SIZE);
                        kfree(fwbuf);
-                       return -EFAULT;
                }
-               ret = intel_scu_ipc_mrstfw_update(fwbuf, MAX_FW_SIZE);
-               kfree(fwbuf);
                break;
        }
        case INTEL_SCU_IPC_READ_RR_FROM_OSNIB:
@@ -178,6 +180,7 @@ static long scu_ipc_ioctl(struct file *fp, unsigned int cmd,
                                return ret;
                        }
                }
+               break;
        }
        case INTEL_SCU_IPC_FW_REVISION_GET:
        {