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
parent
8c4d12b5af
commit
b4b30ffe8a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue