Re: [PATCH] clk: devres: Skip cleanup action for absent optional clocks

From: Jerome Brunet

Date: Mon Oct 19 2026 - 05:55:45 EST


On Sun, 18 Oct 2026 15:30:09 +0900, Baek Kyu, Kim <pocj8ur4in@xxxxxxxxx> wrote:
> devm_clk_get_optional_enabled_with_rate() registers a disable/unprepare
> action even when the optional lookup returns NULL. If allocating the
> action fails, the error path calls devm_clk_put(dev, NULL), triggering
> warnings in devm_clk_match() and devm_clk_put().
>
> Return NULL after the lookup to skip the unnecessary action registration.
> The state allocated by devm_clk_get_optional() is released when the
> device is detached.
>
> [...]

Reviewed-by: Jerome Brunet <jbrunet@xxxxxxxxxxxx>

--
Jerome