OSDN Git Service

watchdog: cadence: Use devm_clk_get_enabled() helper
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 31 Dec 2022 08:12:28 +0000 (09:12 +0100)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sun, 12 Feb 2023 14:32:49 +0000 (15:32 +0100)
commit616a2fe3cda63d4e6eb3a29f925f14b3766c633e
tree6d62d3fb5f9a699cf7d640d770b3954dd6d8620b
parentc4b8e92bc1a8d860ca53a41c25cd84fa03efaf50
watchdog: cadence: Use devm_clk_get_enabled() helper

The devm_clk_get_enabled() helper:
   - calls devm_clk_get()
   - calls clk_prepare_enable() and registers what is needed in order to
     call clk_disable_unprepare() when needed, as a managed resource.

This simplifies the code and avoids the need of a dedicated function used
with devm_add_action_or_reset().

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/615c6c3c46c3ee8e3136725af0ab0b51e1298091.1672474336.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/cadence_wdt.c