pwm: renesas-tpu: Fix late Runtime PM enablement
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 16 Mar 2020 10:32:15 +0000 (11:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 May 2020 15:23:07 +0000 (17:23 +0200)
commitba37c3bafd7b0db7f3ea6a2957736baa4459ba1d
tree0651f10acc2fd736aaadb2862c0d01954942d31c
parentfdcb9adae67286f22ffd2f43aaf2f2b1de55fbeb
pwm: renesas-tpu: Fix late Runtime PM enablement

[ Upstream commit d5a3c7a4536e1329a758e14340efd0e65252bd3d ]

Runtime PM should be enabled before calling pwmchip_add(), as PWM users
can appear immediately after the PWM chip has been added.
Likewise, Runtime PM should always be disabled after the removal of the
PWM chip, even if the latter failed.

Fixes: 99b82abb0a35b073 ("pwm: Add Renesas TPU PWM driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pwm/pwm-renesas-tpu.c