clk: generalize devm_clk_get() a bit
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 20 May 2022 07:57:35 +0000 (09:57 +0200)
committerStephen Boyd <sboyd@kernel.org>
Thu, 16 Jun 2022 02:22:29 +0000 (19:22 -0700)
commitabae8e57e49aa75f6db76aa866c775721523908f
tree5444821b6910e228d6a7d15afd4d84eb7751efc9
parentaf89cd45603483135bdd238fcb3fa871155a0ae1
clk: generalize devm_clk_get() a bit

Allow to add an exit hook to devm managed clocks. Also use
clk_get_optional() in devm_clk_get_optional instead of open coding it.
The generalisation will be used in the next commit to add some more
devm_clk helpers.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220520075737.758761-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-devres.c