aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-atmel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pwm/pwm-atmel.c')
-rw-r--r--drivers/pwm/pwm-atmel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
index a947c9095d9d..b3b294de88e0 100644
--- a/drivers/pwm/pwm-atmel.c
+++ b/drivers/pwm/pwm-atmel.c
@@ -114,7 +114,7 @@ static int atmel_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
114 u32 val; 114 u32 val;
115 int ret; 115 int ret;
116 116
117 if (test_bit(PWMF_ENABLED, &pwm->flags) && (period_ns != pwm->period)) { 117 if (pwm_is_enabled(pwm) && (period_ns != pwm->period)) {
118 dev_err(chip->dev, "cannot change PWM period while enabled\n"); 118 dev_err(chip->dev, "cannot change PWM period while enabled\n");
119 return -EBUSY; 119 return -EBUSY;
120 } 120 }
@@ -176,7 +176,7 @@ static void atmel_pwm_config_v1(struct pwm_chip *chip, struct pwm_device *pwm,
176 * If the PWM channel is enabled, only update CDTY by using the update 176 * If the PWM channel is enabled, only update CDTY by using the update
177 * register, it needs to set bit 10 of CMR to 0 177 * register, it needs to set bit 10 of CMR to 0
178 */ 178 */
179 if (test_bit(PWMF_ENABLED, &pwm->flags)) 179 if (pwm_is_enabled(pwm))
180 return; 180 return;
181 /* 181 /*
182 * If the PWM channel is disabled, write value to duty and period 182 * If the PWM channel is disabled, write value to duty and period
@@ -191,7 +191,7 @@ static void atmel_pwm_config_v2(struct pwm_chip *chip, struct pwm_device *pwm,
191{ 191{
192 struct atmel_pwm_chip *atmel_pwm = to_atmel_pwm_chip(chip); 192 struct atmel_pwm_chip *atmel_pwm = to_atmel_pwm_chip(chip);
193 193
194 if (test_bit(PWMF_ENABLED, &pwm->flags)) { 194 if (pwm_is_enabled(pwm)) {
195 /* 195 /*
196 * If the PWM channel is enabled, using the duty update register 196 * If the PWM channel is enabled, using the duty update register
197 * to update the value. 197 * to update the value.