mfd: arizona: Ensure 32k clock is put on driver unbind and error
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 15 Jun 2020 13:53:21 +0000 (14:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 07:48:20 +0000 (09:48 +0200)
commit545017c9c8c46a04236c964336a4bcea853b590c
treea97db2b199f754611c84e1621ec4550cca544e00
parent81c62cae5e0a93f5e4fc618a28a22ef700a5eebd
mfd: arizona: Ensure 32k clock is put on driver unbind and error

[ Upstream commit ddff6c45b21d0437ce0c85f8ac35d7b5480513d7 ]

Whilst it doesn't matter if the internal 32k clock register settings
are cleaned up on exit, as the part will be turned off losing any
settings, hence the driver hasn't historially bothered. The external
clock should however be cleaned up, as it could cause clocks to be
left on, and will at best generate a warning on unbind.

Add clean up on both the probe error path and unbind for the 32k
clock.

Fixes: cdd8da8cc66b ("mfd: arizona: Add gating of external MCLKn clocks")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/arizona-core.c