Input: pwm-vibra - prevent unbalanced regulator
authorJonathan Bakker <xc-racer2@live.ca>
Mon, 28 Jan 2019 19:13:01 +0000 (11:13 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:09:42 +0000 (20:09 +0100)
commit0ed72d3f6f1d62a4759595e9c87c725bf110b95b
treefc8001f17e8649aec66d3dbea1f435b7f1c72630
parent98a137cd0484efc07318d6710e1990c939c78af6
Input: pwm-vibra - prevent unbalanced regulator

[ Upstream commit 3ca232df9921f083c3b37ba5fbc76f4d9046268b ]

pwm_vibrator_stop disables the regulator, but it can be called from
multiple places, even when the regulator is already disabled. Fix this
by using regulator_is_enabled check when starting and stopping device.

Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/misc/pwm-vibra.c