diff options
author | David Wu <david.wu@rock-chips.com> | 2017-08-08 11:38:30 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2017-08-18 11:33:07 -0400 |
commit | f90df9cda68d774c600860e32602b04c741bf95c (patch) | |
tree | 5021b586051cd927c7aeff61abc9b82436a701f9 /drivers/pwm/pwm-rockchip.c | |
parent | 27922ff59893e3445f69e397bcd92ae06fa89ca7 (diff) |
pwm: rockchip: Remove the judge from return value of pwm_config()
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>
Diffstat (limited to 'drivers/pwm/pwm-rockchip.c')
-rw-r--r-- | drivers/pwm/pwm-rockchip.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c index ac3cd5ec5310..33bbb5a97b72 100644 --- a/drivers/pwm/pwm-rockchip.c +++ b/drivers/pwm/pwm-rockchip.c | |||
@@ -165,7 +165,7 @@ static void rockchip_pwm_get_state(struct pwm_chip *chip, | |||
165 | clk_disable(pc->pclk); | 165 | clk_disable(pc->pclk); |
166 | } | 166 | } |
167 | 167 | ||
168 | static int rockchip_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, | 168 | static void rockchip_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, |
169 | int duty_ns, int period_ns) | 169 | int duty_ns, int period_ns) |
170 | { | 170 | { |
171 | struct rockchip_pwm_chip *pc = to_rockchip_pwm_chip(chip); | 171 | 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, | |||
188 | 188 | ||
189 | writel(period, pc->base + pc->data->regs.period); | 189 | writel(period, pc->base + pc->data->regs.period); |
190 | writel(duty, pc->base + pc->data->regs.duty); | 190 | writel(duty, pc->base + pc->data->regs.duty); |
191 | |||
192 | return 0; | ||
193 | } | 191 | } |
194 | 192 | ||
195 | static int rockchip_pwm_enable(struct pwm_chip *chip, | 193 | 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, | |||
236 | enabled = false; | 234 | enabled = false; |
237 | } | 235 | } |
238 | 236 | ||
239 | ret = rockchip_pwm_config(chip, pwm, state->duty_cycle, state->period); | 237 | rockchip_pwm_config(chip, pwm, state->duty_cycle, state->period); |
240 | if (ret) { | ||
241 | if (enabled != curstate.enabled) | ||
242 | rockchip_pwm_enable(chip, pwm, !enabled, | ||
243 | state->polarity); | ||
244 | goto out; | ||
245 | } | ||
246 | 238 | ||
247 | if (state->enabled != enabled) { | 239 | if (state->enabled != enabled) { |
248 | ret = rockchip_pwm_enable(chip, pwm, state->enabled, | 240 | ret = rockchip_pwm_enable(chip, pwm, state->enabled, |