Re: [PATCH v8 2/2] clk: qcom: Add LPASS VA CSR heartbeat pulse clock

From: Konrad Dybcio

Date: Fri Sep 18 2026 - 05:50:37 EST


On 9/17/26 3:57 PM, Sarath Ganapathiraju via B4 Relay wrote:
> From: Sarath Ganapathiraju <sarath.ganapathiraju@xxxxxxxxxxxxxxxx>
>
> The HeartBeat Pulse, also known as RateGen Pulse, synchronizes the
> start of DMAs and Codec Interfaces for the audio usecases and can
> serve as a periodic wakeup source for the DSP.
>
> Add the LPASS VA CSR driver that models the rate generator as a clock
> provider so it is enabled and disabled automatically alongside the
> other clocks during runtime PM resume and suspend.

[...]

> + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &csr->hb.hw);
> + if (ret)
> + goto err_pm_runtime_put;
> +
> + pm_runtime_put(dev);
> +
> + return 0;
> +
> +err_pm_runtime_put:
> + pm_runtime_put(dev);
> +
> + return ret;

You could do return ret above to remove the separate error path
Or better yet, you can use the cleanup macros from
linux/pm_runtime.h, like PM_RUNTIME_ACQUIRE_IF_ENABLED() to get
rid of the gotos altogether

Konrad