Devicetree
 help / color / mirror / Atom feed
From: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Srinivas Kandagatla <srini@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Subject: Re: [PATCH v2 2/3] ASoC: qcom: q6apm-lpass-dais: Add MI2S clock control
Date: Mon, 15 Jun 2026 15:30:38 +0530	[thread overview]
Message-ID: <a99367df-7010-470d-bec7-0024b0bb63ad@oss.qualcomm.com> (raw)
In-Reply-To: <e6567656-8745-4f07-9636-7779d32ccbcf@sirena.org.uk>



On 6/8/2026 5:31 PM, Mark Brown wrote:
> 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...
> 
Yes right, Thanks for pointing out.

I will initialize sysclk and enabled to NULL and add an explicit error
return in the default case of the switch statement to handle invalid 
clock IDs safely.

>> +	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.
> 

ack,

will fix this in next version.

>> +	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?


Yes, an of_node_put(node) is required before the early return to avoid a 
reference leak.

I will update the code to use for_each_child_of_node_scoped() to handle 
the cleanup automatically, or explicitly call of_node_put() before 
returning.

Thanks & Regards,
Rafi.


  reply	other threads:[~2026-06-15 10:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08  2:30 [PATCH v2 0/3] ASoC: qcom: qdsp6: Add MI2S clock control Mohammad Rafi Shaik
2026-06-08  2:30 ` [PATCH v2 1/3] ASoC: dt-bindings: qcom,q6apm-lpass-dais: Document DAI subnode Mohammad Rafi Shaik
2026-06-08  4:44   ` sashiko-bot
2026-06-08  9:59   ` Krzysztof Kozlowski
2026-06-08  2:30 ` [PATCH v2 2/3] ASoC: qcom: q6apm-lpass-dais: Add MI2S clock control Mohammad Rafi Shaik
2026-06-08  2:38   ` sashiko-bot
2026-06-08  2:49   ` Val Packett
2026-06-15  9:46     ` Mohammad Rafi Shaik
2026-06-08 12:01   ` Mark Brown
2026-06-15 10:00     ` Mohammad Rafi Shaik [this message]
2026-06-08  2:30 ` [PATCH v2 3/3] ASoC: qcom: sc8280xp: ASoC: qcom: sc8280xp: enhance machine driver for board-specific config Mohammad Rafi Shaik
2026-06-08  2:41   ` sashiko-bot
2026-06-08 12:08   ` Mark Brown
2026-06-15 10:11     ` Mohammad Rafi Shaik
2026-06-08  8:23 ` [PATCH v2 0/3] ASoC: qcom: qdsp6: Add MI2S clock control Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a99367df-7010-470d-bec7-0024b0bb63ad@oss.qualcomm.com \
    --to=mohammad.rafi.shaik@oss.qualcomm.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=srini@kernel.org \
    --cc=srinivas.kandagatla@oss.qualcomm.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox