summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2021-09-09 11:48:49 +0200
committerThierry Reding <thierry.reding@gmail.com>2021-11-05 11:51:41 +0100
commit4ad91a227817ae48f931595d1101fc7100073ce9 (patch)
tree66c8a2c4961fcd269c3e933e8a2cb11a5ca7f5fa /include
parentpwm: Add might_sleep() annotations for !CONFIG_PWM API functions (diff)
downloadlinux-4ad91a227817ae48f931595d1101fc7100073ce9.tar.xz
linux-4ad91a227817ae48f931595d1101fc7100073ce9.zip
pwm: Make it explicit that pwm_apply_state() might sleep
At least some implementations sleep. So mark pwm_apply_state() with a might_sleep() to make callers aware. In the worst case this uncovers a valid atomic user, then we revert this patch and at least gained some more knowledge and then can work on a concept similar to gpio_get_value/gpio_get_value_cansleep. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pwm.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index 515e33978e97..e6dac95e4960 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -441,6 +441,7 @@ static inline void pwm_free(struct pwm_device *pwm)
static inline int pwm_apply_state(struct pwm_device *pwm,
const struct pwm_state *state)
{
+ might_sleep();
return -ENOTSUPP;
}
@@ -452,6 +453,7 @@ static inline int pwm_adjust_config(struct pwm_device *pwm)
static inline int pwm_config(struct pwm_device *pwm, int duty_ns,
int period_ns)
{
+ might_sleep();
return -EINVAL;
}
@@ -464,11 +466,13 @@ static inline int pwm_capture(struct pwm_device *pwm,
static inline int pwm_enable(struct pwm_device *pwm)
{
+ might_sleep();
return -EINVAL;
}
static inline void pwm_disable(struct pwm_device *pwm)
{
+ might_sleep();
}
static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data)