aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pwm/pwm-clps711x.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pwm/pwm-clps711x.c b/drivers/pwm/pwm-clps711x.c
index 26ec24e457b1..7e16b7def0dc 100644
--- a/drivers/pwm/pwm-clps711x.c
+++ b/drivers/pwm/pwm-clps711x.c
@@ -48,7 +48,7 @@ static void clps711x_pwm_update_val(struct clps711x_chip *priv, u32 n, u32 v)
48static unsigned int clps711x_get_duty(struct pwm_device *pwm, unsigned int v) 48static unsigned int clps711x_get_duty(struct pwm_device *pwm, unsigned int v)
49{ 49{
50 /* Duty cycle 0..15 max */ 50 /* Duty cycle 0..15 max */
51 return DIV_ROUND_CLOSEST(v * 0xf, pwm_get_period(pwm)); 51 return DIV_ROUND_CLOSEST(v * 0xf, pwm->args.period);
52} 52}
53 53
54static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) 54static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
@@ -71,7 +71,7 @@ static int clps711x_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
71 struct clps711x_chip *priv = to_clps711x_chip(chip); 71 struct clps711x_chip *priv = to_clps711x_chip(chip);
72 unsigned int duty; 72 unsigned int duty;
73 73
74 if (period_ns != pwm_get_period(pwm)) 74 if (period_ns != pwm->args.period)
75 return -EINVAL; 75 return -EINVAL;
76 76
77 duty = clps711x_get_duty(pwm, duty_ns); 77 duty = clps711x_get_duty(pwm, duty_ns);