diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-07-05 10:06:50 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2023-10-13 10:07:17 +0200 |
commit | a6e5654e0b8b53e2d0e316bc7cecb81dd8371f18 (patch) | |
tree | 9c264bb975bdef7b27c96f75e2ffc97ec1a07dba /drivers/pwm | |
parent | pwm: cros-ec: Put per-channel data into driver data (diff) | |
download | linux-a6e5654e0b8b53e2d0e316bc7cecb81dd8371f18.tar.xz linux-a6e5654e0b8b53e2d0e316bc7cecb81dd8371f18.zip |
pwm: Drop pwm_[sg]et_chip_data()
The semantic of chip_data is a bit surprising as it's cleared when
pwm_put() is called. Also there is a big overlap with the standard driver
data.
All drivers were adapted to not make use of chip_data any more, so it can
go away.
Link: https://lore.kernel.org/r/20230705080650.2353391-9-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r-- | drivers/pwm/core.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index a2824eb4e236..29078486534d 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -208,36 +208,6 @@ static void of_pwmchip_remove(struct pwm_chip *chip) of_node_put(chip->dev->of_node); } -/** - * pwm_set_chip_data() - set private chip data for a PWM - * @pwm: PWM device - * @data: pointer to chip-specific data - * - * Returns: 0 on success or a negative error code on failure. - */ -int pwm_set_chip_data(struct pwm_device *pwm, void *data) -{ - if (!pwm) - return -EINVAL; - - pwm->chip_data = data; - - return 0; -} -EXPORT_SYMBOL_GPL(pwm_set_chip_data); - -/** - * pwm_get_chip_data() - get private chip data for a PWM - * @pwm: PWM device - * - * Returns: A pointer to the chip-private data for the PWM device. - */ -void *pwm_get_chip_data(struct pwm_device *pwm) -{ - return pwm ? pwm->chip_data : NULL; -} -EXPORT_SYMBOL_GPL(pwm_get_chip_data); - static bool pwm_ops_check(const struct pwm_chip *chip) { const struct pwm_ops *ops = chip->ops; @@ -980,7 +950,6 @@ void pwm_put(struct pwm_device *pwm) if (pwm->chip->ops->free) pwm->chip->ops->free(pwm->chip, pwm); - pwm_set_chip_data(pwm, NULL); pwm->label = NULL; module_put(pwm->chip->owner); |