pwm: lpss: Release runtime-pm reference from the driver's remove callback
[ Upstream commit42885551ce
] For each pwm output which gets enabled through pwm_lpss_apply(), we do a pm_runtime_get_sync(). This commit adds pm_runtime_put() calls to pwm_lpss_remove() to balance these when the driver gets removed with some of the outputs still enabled. Fixes:f080be27d7
("pwm: lpss: Add support for runtime PM") Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
27db95dfd2
commit
bfd5e35ba3
@ -216,6 +216,12 @@ EXPORT_SYMBOL_GPL(pwm_lpss_probe);
|
|||||||
|
|
||||||
int pwm_lpss_remove(struct pwm_lpss_chip *lpwm)
|
int pwm_lpss_remove(struct pwm_lpss_chip *lpwm)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < lpwm->info->npwm; i++) {
|
||||||
|
if (pwm_is_enabled(&lpwm->chip.pwms[i]))
|
||||||
|
pm_runtime_put(lpwm->chip.dev);
|
||||||
|
}
|
||||||
return pwmchip_remove(&lpwm->chip);
|
return pwmchip_remove(&lpwm->chip);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(pwm_lpss_remove);
|
EXPORT_SYMBOL_GPL(pwm_lpss_remove);
|
||||||
|
Reference in New Issue
Block a user