pwm: rcar: Use PM Runtime to control module clock
authorHien Dang <hien.dang.eb@renesas.com>
Tue, 13 Mar 2018 08:18:17 +0000 (17:18 +0900)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 27 Mar 2018 23:26:15 +0000 (01:26 +0200)
Runtime PM API (pm_runtime_get_sync/pm_runtime_put) should be used
to control module clock instead of clk_prepare_enable and
clk_disable_unprepare.

Signed-off-by: Hien Dang <hien.dang.eb@renesas.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-rcar.c

index 0fcf94ffad321d8bb10911c6cdb65eebd8c8161b..f4d8767f804e1eebf235814f61e86eae6b321638 100644 (file)
@@ -134,16 +134,12 @@ static int rcar_pwm_set_counter(struct rcar_pwm_chip *rp, int div, int duty_ns,
 
 static int rcar_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
 {
-       struct rcar_pwm_chip *rp = to_rcar_pwm_chip(chip);
-
-       return clk_prepare_enable(rp->clk);
+       return pm_runtime_get_sync(chip->dev);
 }
 
 static void rcar_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
 {
-       struct rcar_pwm_chip *rp = to_rcar_pwm_chip(chip);
-
-       clk_disable_unprepare(rp->clk);
+       pm_runtime_put(chip->dev);
 }
 
 static int rcar_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,