mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
pwm: Clear chip_data in pwm_put()
After a PWM is disposed by its user the per chip data becomes invalid. Clear the data in common code instead of the device drivers to get consistent behaviour. Before this patch only three of nine drivers cleaned up here. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
738a1cfec2
commit
e926b12c61
4 changed files with 1 additions and 3 deletions
|
@ -877,6 +877,7 @@ 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->ops->owner);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue