Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] sound: soc: stm: stm32_sai: Use dev_err_probe()
@ 2025-04-03  7:41 shao.mingyin
  2025-04-03 11:10 ` Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: shao.mingyin @ 2025-04-03  7:41 UTC (permalink / raw)
  To: olivier.moysan
  Cc: arnaud.pouliquen, lgirdwood, broonie, perex, tiwai,
	mcoquelin.stm32, alexandre.torgue, linux-sound, linux-stm32,
	linux-arm-kernel, linux-kernel, yang.yang29, xu.xin16,
	ye.xingchen, zhang.enpei

From: Zhang Enpei <zhang.enpei@zte.com.cn>

Replace the open-code with dev_err_probe() to simplify the code.

Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
 sound/soc/stm/stm32_sai.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c
index 504a14584765..fa821e3fb427 100644
--- a/sound/soc/stm/stm32_sai.c
+++ b/sound/soc/stm/stm32_sai.c
@@ -169,20 +169,14 @@ static int stm32_sai_get_parent_clk(struct stm32_sai_data *sai)
 	struct device *dev = &sai->pdev->dev;

 	sai->clk_x8k = devm_clk_get(dev, "x8k");
-	if (IS_ERR(sai->clk_x8k)) {
-		if (PTR_ERR(sai->clk_x8k) != -EPROBE_DEFER)
-			dev_err(dev, "missing x8k parent clock: %ld\n",
-				PTR_ERR(sai->clk_x8k));
-		return PTR_ERR(sai->clk_x8k);
-	}
+	if (IS_ERR(sai->clk_x8k))
+		return dev_err_probe(dev, PTR_ERR(sai->clk_x8k),
+				     "missing x8k parent clock\n");

 	sai->clk_x11k = devm_clk_get(dev, "x11k");
-	if (IS_ERR(sai->clk_x11k)) {
-		if (PTR_ERR(sai->clk_x11k) != -EPROBE_DEFER)
-			dev_err(dev, "missing x11k parent clock: %ld\n",
-				PTR_ERR(sai->clk_x11k));
-		return PTR_ERR(sai->clk_x11k);
-	}
+	if (IS_ERR(sai->clk_x11k))
+		return dev_err_probe(dev, PTR_ERR(sai->clk_x11k),
+				     "missing x11k parent clock\n");

 	return 0;
 }
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sound: soc: stm: stm32_sai: Use dev_err_probe()
  2025-04-03  7:41 [PATCH] sound: soc: stm: stm32_sai: Use dev_err_probe() shao.mingyin
@ 2025-04-03 11:10 ` Mark Brown
  2025-04-04  6:12 ` Krzysztof Kozlowski
  2025-04-07 23:35 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-04-03 11:10 UTC (permalink / raw)
  To: shao.mingyin
  Cc: olivier.moysan, arnaud.pouliquen, lgirdwood, perex, tiwai,
	mcoquelin.stm32, alexandre.torgue, linux-sound, linux-stm32,
	linux-arm-kernel, linux-kernel, yang.yang29, xu.xin16,
	ye.xingchen, zhang.enpei

[-- Attachment #1: Type: text/plain, Size: 529 bytes --]

On Thu, Apr 03, 2025 at 03:41:42PM +0800, shao.mingyin@zte.com.cn wrote:
> From: Zhang Enpei <zhang.enpei@zte.com.cn>
> 
> Replace the open-code with dev_err_probe() to simplify the code.

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sound: soc: stm: stm32_sai: Use dev_err_probe()
  2025-04-03  7:41 [PATCH] sound: soc: stm: stm32_sai: Use dev_err_probe() shao.mingyin
  2025-04-03 11:10 ` Mark Brown
@ 2025-04-04  6:12 ` Krzysztof Kozlowski
  2025-04-07 23:35 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-04  6:12 UTC (permalink / raw)
  To: shao.mingyin, olivier.moysan
  Cc: arnaud.pouliquen, lgirdwood, broonie, perex, tiwai,
	mcoquelin.stm32, alexandre.torgue, linux-sound, linux-stm32,
	linux-arm-kernel, linux-kernel, yang.yang29, xu.xin16,
	ye.xingchen, zhang.enpei

On 03/04/2025 09:41, shao.mingyin@zte.com.cn wrote:
> From: Zhang Enpei <zhang.enpei@zte.com.cn>
> 
> Replace the open-code with dev_err_probe() to simplify the code.
> 
> Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
> ---
The code was correct before 2cfe1ff22555 ("ASoC: stm32: sai: add
stm32mp25 support") and that commit broke it. Some explanation would be
useful instead of blindly generating patches.

Was it done on purpose like that in that commit? Or ST just sent
downstream commit to mainline without changing it?

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sound: soc: stm: stm32_sai: Use dev_err_probe()
  2025-04-03  7:41 [PATCH] sound: soc: stm: stm32_sai: Use dev_err_probe() shao.mingyin
  2025-04-03 11:10 ` Mark Brown
  2025-04-04  6:12 ` Krzysztof Kozlowski
@ 2025-04-07 23:35 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-04-07 23:35 UTC (permalink / raw)
  To: olivier.moysan, shao.mingyin
  Cc: arnaud.pouliquen, lgirdwood, perex, tiwai, mcoquelin.stm32,
	alexandre.torgue, linux-sound, linux-stm32, linux-arm-kernel,
	linux-kernel, yang.yang29, xu.xin16, ye.xingchen, zhang.enpei

On Thu, 03 Apr 2025 15:41:42 +0800, shao.mingyin@zte.com.cn wrote:
> Replace the open-code with dev_err_probe() to simplify the code.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] sound: soc: stm: stm32_sai: Use dev_err_probe()
      commit: d01131e3ce14f9837884aef1f3e463a3a492291f

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-07 23:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03  7:41 [PATCH] sound: soc: stm: stm32_sai: Use dev_err_probe() shao.mingyin
2025-04-03 11:10 ` Mark Brown
2025-04-04  6:12 ` Krzysztof Kozlowski
2025-04-07 23:35 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox