]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFC: trf7970a: disable all regulators on removal
authorPaul Geurts <paul_geurts@live.nl>
Thu, 18 Apr 2024 19:25:38 +0000 (21:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 May 2024 14:32:36 +0000 (16:32 +0200)
commitcffee39d36154e2f62247b01f3ec6f450b311d84
treedab06f523a75acd087528c34e2aad9c8e17bfc38
parent0142cbb87cf6f0565d704feff4f63b371790a83f
NFC: trf7970a: disable all regulators on removal

[ Upstream commit 6bea4f03c6a4e973ef369e15aac88f37981db49e ]

During module probe, regulator 'vin' and 'vdd-io' are used and enabled,
but the vdd-io regulator overwrites the 'vin' regulator pointer. During
remove, only the vdd-io is disabled, as the vin regulator pointer is not
available anymore. When regulator_put() is called during resource
cleanup a kernel warning is given, as the regulator is still enabled.

Store the two regulators in separate pointers and disable both the
regulators on module remove.

Fixes: 49d22c70aaf0 ("NFC: trf7970a: Add device tree option of 1.8 Volt IO voltage")
Signed-off-by: Paul Geurts <paul_geurts@live.nl>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/DB7PR09MB26847A4EBF88D9EDFEB1DA0F950E2@DB7PR09MB2684.eurprd09.prod.outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nfc/trf7970a.c