Re: [PATCH v2 2/3] ASoC: qcom: q6apm-lpass-dais: Add MI2S clock control

From: Mark Brown

Date: Mon Jun 08 2026 - 08:07:13 EST


On Mon, Jun 08, 2026 at 08:00:10AM +0530, Mohammad Rafi Shaik wrote:
> Add support for MI2S clock control within q6apm-lpass DAIs, including
> handling of MCLK, BCLK, and ECLK via the DAI .set_sysclk callback.

> +static int q6i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir)
> +{
> + struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev);
> + struct clk *sysclk;
> + bool *enabled;

Neither sysclk nor enabled are initialised by default...

> + switch (clk_id) {

> + case LPAIF_MI2S_ECLK:
> + sysclk = dai_data->priv[dai->id].eclk;
> + enabled = &dai_data->priv[dai->id].eclk_enabled;
> + break;
> + default:
> + break;
> + }
> +
> + if (sysclk) {

...but we just fall through the switch statement if the clock ID is
invalid and use the values.

> + for_each_child_of_node(dev->of_node, node) {

> + if (IS_ERR(priv->mclk)) {
> + if (PTR_ERR(priv->mclk) == -EPROBE_DEFER)
> + return dev_err_probe(dev, PTR_ERR(priv->mclk),
> + "unable to get mi2s mclk\n");
> + priv->mclk = NULL;
> + }

Do we need to drop any OF references on early return?

Attachment: signature.asc
Description: PGP signature