pwm: Mark all devices as "might sleep"
authorThierry Reding <thierry.reding@gmail.com>
Thu, 21 Jan 2016 14:04:59 +0000 (15:04 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 21 Jan 2016 14:04:59 +0000 (15:04 +0100)
Commit d1cd21427747 ("pwm: Set enable state properly on failed call to
enable") introduced a mutex that is needed to protect internal state of
PWM devices. Since that mutex is acquired in pwm_set_polarity() and in
pwm_enable() and might potentially block, all PWM devices effectively
become "might sleep".

It's rather pointless to keep the .can_sleep field around, but given
that there are external users let's postpone the removal for the next
release cycle.

Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c

index d24ca5f281b4bbd98e5ce86e8f454c270d86fe10..7831bc6b51dddb66960f8ef97fde2da1ce33572a 100644 (file)
@@ -889,7 +889,7 @@ EXPORT_SYMBOL_GPL(devm_pwm_put);
   */
 bool pwm_can_sleep(struct pwm_device *pwm)
 {
-       return pwm->chip->can_sleep;
+       return true;
 }
 EXPORT_SYMBOL_GPL(pwm_can_sleep);