pwm: Add the pwm_is_enabled() helper
Some PWM drivers are testing the PWMF_ENABLED flag. Create a helper function to hide the logic behind enabled test. This will allow us to smoothly move from the current approach to an atomic PWM update approach. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:

committed by
Thierry Reding

parent
d770e558e2
commit
5c31252c4a
@@ -114,7 +114,7 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
|
||||
unsigned long long c;
|
||||
unsigned long period_cycles, duty_cycles, prescale;
|
||||
unsigned int period_ms;
|
||||
bool enable = test_bit(PWMF_ENABLED, &pwm->flags);
|
||||
bool enable = pwm_is_enabled(pwm);
|
||||
int wait_count = 0, fifoav;
|
||||
u32 cr, sr;
|
||||
|
||||
|
Reference in New Issue
Block a user