clk: si5341: Fix clock HW provider cleanup
authorRobert Hancock <robert.hancock@calian.com>
Wed, 12 Jan 2022 20:38:16 +0000 (14:38 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:05:31 +0000 (11:05 +0100)
commit8fc3bd2c347ba23fa9dbc25be4f82c0b761e9399
tree6510ab9b64ee95f228c18dd44bc8b12ef06f4e01
parent4919c073780614df6f996ac33309fbbf2f67b199
clk: si5341: Fix clock HW provider cleanup

commit 49a8f2bc8d88702783c7e163ec84374e9a022f71 upstream.

The call to of_clk_add_hw_provider was not undone on remove or on probe
failure, which could cause an oops on a subsequent attempt to retrieve
clocks for the removed device. Switch to the devm version of the
function to avoid this issue.

Fixes: 3044a860fd09 ("clk: Add Si5341/Si5340 driver")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20220112203816.1784610-1-robert.hancock@calian.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/clk-si5341.c