]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00283192 Avoid vpu rmmod failure and modprobe warning
authorHongzhang Yang <Hongzhang.Yang@freescale.com>
Thu, 10 Oct 2013 03:12:06 +0000 (11:12 +0800)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:55:55 +0000 (09:55 +0800)
- Avoid vpu rmmod failure caused by regulator free failure
  Do not call regulator_put because regulators returned from
  devm_regulator_get are automatically regulator_put() on
  driver detach

- Avoid vpu modprobe warning caused by unbalanced pm_runtime_enable
  Add missing call to pm_runtime_disable

Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
drivers/mxc/vpu/mxc_vpu.c

index 8c016f5861dd8e468ec2c588c02f7c575048014c..edb8c947359ed8b24c257658f5ca43f405b663f2 100644 (file)
@@ -141,11 +141,13 @@ static wait_queue_head_t vpu_queue;
 static int vpu_jpu_irq;
 #endif
 
+#ifdef CONFIG_PM
 static unsigned int regBk[64];
+static unsigned int pc_before_suspend;
+#endif
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
 static struct regulator *vpu_regulator;
 #endif
-static unsigned int pc_before_suspend;
 static atomic_t clk_cnt_from_ioc = ATOMIC_INIT(0);
 
 #define        READ_REG(x)             readl_relaxed(vpu_base + x)
@@ -193,7 +195,7 @@ static long vpu_power_get(bool on)
                ret = IS_ERR(vpu_regulator);
 #endif
        } else {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
                if (!IS_ERR(vpu_regulator))
                        regulator_put(vpu_regulator);
 #endif
@@ -1026,6 +1028,9 @@ out:
 
 static int vpu_dev_remove(struct platform_device *pdev)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+       pm_runtime_disable(&pdev->dev);
+#endif
        free_irq(vpu_ipi_irq, &vpu_data);
 #ifdef MXC_VPU_HAS_JPU
        free_irq(vpu_jpu_irq, &vpu_data);