diff options
Diffstat (limited to 'drivers/pwm/core.c')
-rw-r--r-- | drivers/pwm/core.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 2c6b155002a2..93772ab8d7e3 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -558,6 +558,15 @@ int pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state) struct pwm_chip *chip; int err; + /* + * Some lowlevel driver's implementations of .apply() make use of + * mutexes, also with some drivers only returning when the new + * configuration is active calling pwm_apply_state() from atomic context + * is a bad idea. So make it explicit that calling this function might + * sleep. + */ + might_sleep(); + if (!pwm || !state || !state->period || state->duty_cycle > state->period) return -EINVAL; |