aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2024-02-14 10:33:31 +0100
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2024-02-15 07:55:28 +0100
commit1b6e26035e9523a33c85ba95467de876ccbdf796 (patch)
tree6637c11bbb1777c530edbcb4d07800e48903da67
parenta9fb4672a6a25a794e0213e8c0215fc8609009ac (diff)
downloadlinux-pwm-lifetime-tracking.tar.gz
pwm: Make pwmchip_[sg]et_drvdata() a wrapper around dev_set_drvdata()pwm-lifetime-tracking
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/4f313db0d231fba97783926e74ed361586c1f849.1707900770.git.u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-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 8c801085462cf..699052b380624 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)