1
0
Fork 0

hwmon: mma8451: Add regulator_disable to avoid WARN_ON

In probe function, if probe fails, the enabled regulator will cause a
WARN_ON.
Add regulator_diable when error occurs in probe function.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Clark Wang 2019-09-06 20:22:40 +08:00 committed by Dong Aisheng
parent 8c4d12b5af
commit b4b30ffe8a
1 changed files with 4 additions and 0 deletions

View File

@ -510,6 +510,10 @@ err_register_polled_device:
err_alloc_poll_device:
hwmon_device_unregister(&client->dev);
err_out:
if (!IS_ERR(vdd))
regulator_disable(vdd);
if (!IS_ERR(vdd_io))
regulator_disable(vdd_io);
return result;
}