mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
HID: i2c-hid: goodix: Disable VDD on VDDIO enable failure
If enabling VDDIO fails after VDD has been enabled, the power-up
path returns without disabling VDD. This leaves the regulator enabled
and its enable count unbalanced.
Disable VDD before returning the VDDIO error.
Fixes: eb16f59e8e ("HID: i2c-hid: goodix: Add mainboard-vddio-supply")
Signed-off-by: Chao Huang <huangchao@kylinos.cn>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
2061075360
commit
8e2c560fae
|
|
@ -51,8 +51,10 @@ static int goodix_i2c_hid_power_up(struct i2chid_ops *ops)
|
|||
return ret;
|
||||
|
||||
ret = regulator_enable(ihid_goodix->vddio);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
regulator_disable(ihid_goodix->vdd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ihid_goodix->timings->post_power_delay_ms)
|
||||
msleep(ihid_goodix->timings->post_power_delay_ms);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user