Merge tag 'tegra-for-5.7-asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra...
[linux-2.6-microblaze.git] / drivers / pwm / pwm-renesas-tpu.c
index 4a855a2..81ad5a5 100644 (file)
@@ -415,16 +415,15 @@ static int tpu_probe(struct platform_device *pdev)
        tpu->chip.base = -1;
        tpu->chip.npwm = TPU_CHANNEL_MAX;
 
+       pm_runtime_enable(&pdev->dev);
+
        ret = pwmchip_add(&tpu->chip);
        if (ret < 0) {
                dev_err(&pdev->dev, "failed to register PWM chip\n");
+               pm_runtime_disable(&pdev->dev);
                return ret;
        }
 
-       dev_info(&pdev->dev, "TPU PWM %d registered\n", tpu->pdev->id);
-
-       pm_runtime_enable(&pdev->dev);
-
        return 0;
 }
 
@@ -434,12 +433,10 @@ static int tpu_remove(struct platform_device *pdev)
        int ret;
 
        ret = pwmchip_remove(&tpu->chip);
-       if (ret)
-               return ret;
 
        pm_runtime_disable(&pdev->dev);
 
-       return 0;
+       return ret;
 }
 
 #ifdef CONFIG_OF