Commit 27d9a4d6 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding

pwm: Add might_sleep() annotations for !CONFIG_PWM API functions

The normal implementations of these functions make use of mutexes. To
make it obvious that these functions might sleep also add annotations to
the dummy implementations in the !CONFIG_PWM case.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 6f897a10
...@@ -429,11 +429,13 @@ struct pwm_device *devm_fwnode_pwm_get(struct device *dev, ...@@ -429,11 +429,13 @@ struct pwm_device *devm_fwnode_pwm_get(struct device *dev,
#else #else
static inline struct pwm_device *pwm_request(int pwm_id, const char *label) static inline struct pwm_device *pwm_request(int pwm_id, const char *label)
{ {
might_sleep();
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
static inline void pwm_free(struct pwm_device *pwm) static inline void pwm_free(struct pwm_device *pwm)
{ {
might_sleep();
} }
static inline int pwm_apply_state(struct pwm_device *pwm, static inline int pwm_apply_state(struct pwm_device *pwm,
...@@ -493,12 +495,14 @@ static inline struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip, ...@@ -493,12 +495,14 @@ static inline struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
unsigned int index, unsigned int index,
const char *label) const char *label)
{ {
might_sleep();
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
static inline struct pwm_device *pwm_get(struct device *dev, static inline struct pwm_device *pwm_get(struct device *dev,
const char *consumer) const char *consumer)
{ {
might_sleep();
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
...@@ -506,16 +510,19 @@ static inline struct pwm_device *of_pwm_get(struct device *dev, ...@@ -506,16 +510,19 @@ static inline struct pwm_device *of_pwm_get(struct device *dev,
struct device_node *np, struct device_node *np,
const char *con_id) const char *con_id)
{ {
might_sleep();
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
static inline void pwm_put(struct pwm_device *pwm) static inline void pwm_put(struct pwm_device *pwm)
{ {
might_sleep();
} }
static inline struct pwm_device *devm_pwm_get(struct device *dev, static inline struct pwm_device *devm_pwm_get(struct device *dev,
const char *consumer) const char *consumer)
{ {
might_sleep();
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
...@@ -523,6 +530,7 @@ static inline struct pwm_device *devm_of_pwm_get(struct device *dev, ...@@ -523,6 +530,7 @@ static inline struct pwm_device *devm_of_pwm_get(struct device *dev,
struct device_node *np, struct device_node *np,
const char *con_id) const char *con_id)
{ {
might_sleep();
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
...@@ -530,6 +538,7 @@ static inline struct pwm_device * ...@@ -530,6 +538,7 @@ static inline struct pwm_device *
devm_fwnode_pwm_get(struct device *dev, struct fwnode_handle *fwnode, devm_fwnode_pwm_get(struct device *dev, struct fwnode_handle *fwnode,
const char *con_id) const char *con_id)
{ {
might_sleep();
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment