]> git.kernelconcepts.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)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:34 +0000 (10:06 +0200)
- 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 ecd286b8b82599ffae425dc3b62ba2a02b6698a7..96c79d5add1ce0279fb7602fb4bdd244afab7ba2 100644 (file)
@@ -140,11 +140,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)
@@ -192,7 +194,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
@@ -1035,6 +1037,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);