aboutsummaryrefslogtreecommitdiff
path: root/include/linux/pwm.h
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2024-03-17 11:40:37 +0100
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2024-04-30 18:57:07 +0200
commit38ae7142e35165571123997addd71393a9dabde5 (patch)
tree4ef24e6c0d9a4250db09495b336665c4f08f4438 /include/linux/pwm.h
parentc6837aa18016da3e524eb7bb51b8941c1ce8cd73 (diff)
pwm: Make pwmchip_[sg]et_drvdata() a wrapper around dev_set_drvdata()
Now that a pwm_chip has a dedicated struct device, pwmchip_set_drvdata() and pwmchip_get_drvdata() can be made thin wrappers around dev_set_drvdata() and dev_get_drvdata() respectively and the previously needed pointer can be dropped from struct pwm_chip. Link: https://lore.kernel.org/r/a5e05bd2d83421a26fdef6a87d69253c0f98becf.1710670958.git.u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'include/linux/pwm.h')
-rw-r--r--include/linux/pwm.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index 495e23761f34..60b92c2c75ef 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -274,7 +274,6 @@ struct pwm_ops {
* @of_xlate: request a PWM device given a device tree PWM specifier
* @atomic: can the driver's ->apply() be called in atomic context
* @uses_pwmchip_alloc: signals if pwmchip_allow was used to allocate this chip
- * @driver_data: Private pointer for driver specific info
* @pwms: array of PWM devices allocated by the framework
*/
struct pwm_chip {
@@ -290,7 +289,6 @@ struct pwm_chip {
/* only used internally by the PWM framework */
bool uses_pwmchip_alloc;
- void *driver_data;
struct pwm_device pwms[] __counted_by(npwm);
};
@@ -301,20 +299,12 @@ static inline struct device *pwmchip_parent(const struct pwm_chip *chip)
static inline void *pwmchip_get_drvdata(struct pwm_chip *chip)
{
- /*
- * After pwm_chip got a dedicated struct device, this can be replaced by
- * dev_get_drvdata(&chip->dev);
- */
- return chip->driver_data;
+ return dev_get_drvdata(&chip->dev);
}
static inline void pwmchip_set_drvdata(struct pwm_chip *chip, void *data)
{
- /*
- * After pwm_chip got a dedicated struct device, this can be replaced by
- * dev_set_drvdata(&chip->dev, data);
- */
- chip->driver_data = data;
+ dev_set_drvdata(&chip->dev, data);
}
#if IS_ENABLED(CONFIG_PWM)