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:

committed by
Thierry Reding

parent
738a1cfec2
commit
e926b12c61
@@ -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);
|
||||
|
Reference in New Issue
Block a user