Input: pwm-vibra - prevent unbalanced regulator
authorJonathan Bakker <xc-racer2@live.ca>
Mon, 28 Jan 2019 19:13:01 +0000 (11:13 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 28 Jan 2019 19:24:18 +0000 (11:24 -0800)
commit3ca232df9921f083c3b37ba5fbc76f4d9046268b
treef9e6dac49b74e92cec38f1dbd7c6b500c185acbc
parent4d741f3dd11c2a8a11536d568f14ab0321169f3d
Input: pwm-vibra - prevent unbalanced regulator

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>
drivers/input/misc/pwm-vibra.c