]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
pwm: rockchip: Remove the judge from return value of pwm_config()
authorDavid Wu <david.wu@rock-chips.com>
Tue, 8 Aug 2017 15:38:30 +0000 (23:38 +0800)
committerThierry Reding <thierry.reding@gmail.com>
Fri, 18 Aug 2017 15:33:07 +0000 (17:33 +0200)
It seems the rockchip_pwm_config() always returns the result 0, so
remove the judge.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-rockchip.c

index ac3cd5ec5310d5e5bae276c1d04a21f9d808fb72..33bbb5a97b723f77d892aff35c5b86dd0c5f050b 100644 (file)
@@ -165,7 +165,7 @@ static void rockchip_pwm_get_state(struct pwm_chip *chip,
        clk_disable(pc->pclk);
 }
 
-static int rockchip_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
+static void rockchip_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
                               int duty_ns, int period_ns)
 {
        struct rockchip_pwm_chip *pc = to_rockchip_pwm_chip(chip);
@@ -188,8 +188,6 @@ static int rockchip_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
 
        writel(period, pc->base + pc->data->regs.period);
        writel(duty, pc->base + pc->data->regs.duty);
-
-       return 0;
 }
 
 static int rockchip_pwm_enable(struct pwm_chip *chip,
@@ -236,13 +234,7 @@ static int rockchip_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                enabled = false;
        }
 
-       ret = rockchip_pwm_config(chip, pwm, state->duty_cycle, state->period);
-       if (ret) {
-               if (enabled != curstate.enabled)
-                       rockchip_pwm_enable(chip, pwm, !enabled,
-                                     state->polarity);
-               goto out;
-       }
+       rockchip_pwm_config(chip, pwm, state->duty_cycle, state->period);
 
        if (state->enabled != enabled) {
                ret = rockchip_pwm_enable(chip, pwm, state->enabled,