* [PATCH 0/2] ASoC: cirrus: ep93xx-i2s: Clean up resource management
@ 2026-11-17 4:21 phucduc.bui
2026-11-17 4:21 ` [PATCH 1/2] ASoC: cirrus: ep93xx-i2s: Simplify platform_get_irq() error check phucduc.bui
2026-11-17 4:21 ` [PATCH 2/2] ASoC: cirrus: ep93xx-i2s: Use devm_clk_get() phucduc.bui
0 siblings, 2 replies; 3+ messages in thread
From: phucduc.bui @ 2026-11-17 4:21 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Jihed Chaibi, Kuninori Morimoto, linux-sound, linux-kernel,
bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Hi all,
This series simplifies IRQ error checking and clock resource
management in the ep93xx-i2s driver.
Compile-tested only.
Best regards,
Phuc
bui duc phuc (2):
ASoC: cirrus: ep93xx-i2s: Simplify platform_get_irq() error check
ASoC: cirrus: ep93xx-i2s: Use devm_clk_get()
sound/soc/cirrus/ep93xx-i2s.c | 51 +++++++++--------------------------
1 file changed, 13 insertions(+), 38 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] ASoC: cirrus: ep93xx-i2s: Simplify platform_get_irq() error check
2026-11-17 4:21 [PATCH 0/2] ASoC: cirrus: ep93xx-i2s: Clean up resource management phucduc.bui
@ 2026-11-17 4:21 ` phucduc.bui
2026-11-17 4:21 ` [PATCH 2/2] ASoC: cirrus: ep93xx-i2s: Use devm_clk_get() phucduc.bui
1 sibling, 0 replies; 3+ messages in thread
From: phucduc.bui @ 2026-11-17 4:21 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Jihed Chaibi, Kuninori Morimoto, linux-sound, linux-kernel,
bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
platform_get_irq() is documented to return a non-zero IRQ number on
success and a negative error number on failure. Drop the special
handling of a zero return value and check only for irq < 0.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/cirrus/ep93xx-i2s.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c
index 97816fb75368..8dcfc6717e19 100644
--- a/sound/soc/cirrus/ep93xx-i2s.c
+++ b/sound/soc/cirrus/ep93xx-i2s.c
@@ -462,8 +462,8 @@ static int ep93xx_i2s_probe(struct platform_device *pdev)
if (IS_ENABLED(CONFIG_SND_EP93XX_SOC_I2S_WATCHDOG)) {
int irq = platform_get_irq(pdev, 0);
- if (irq <= 0)
- return irq < 0 ? irq : -ENODEV;
+ if (irq < 0)
+ return irq;
err = devm_request_irq(&pdev->dev, irq, ep93xx_i2s_interrupt, 0,
pdev->name, info);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] ASoC: cirrus: ep93xx-i2s: Use devm_clk_get()
2026-11-17 4:21 [PATCH 0/2] ASoC: cirrus: ep93xx-i2s: Clean up resource management phucduc.bui
2026-11-17 4:21 ` [PATCH 1/2] ASoC: cirrus: ep93xx-i2s: Simplify platform_get_irq() error check phucduc.bui
@ 2026-11-17 4:21 ` phucduc.bui
1 sibling, 0 replies; 3+ messages in thread
From: phucduc.bui @ 2026-11-17 4:21 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Jihed Chaibi, Kuninori Morimoto, linux-sound, linux-kernel,
bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Use devm_clk_get() to manage clock references automatically,
simplifying the error path in probe() and allowing the remove()
callback to be dropped.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/cirrus/ep93xx-i2s.c | 47 ++++++++---------------------------
1 file changed, 11 insertions(+), 36 deletions(-)
diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c
index 8dcfc6717e19..f2d55763a02d 100644
--- a/sound/soc/cirrus/ep93xx-i2s.c
+++ b/sound/soc/cirrus/ep93xx-i2s.c
@@ -471,54 +471,30 @@ static int ep93xx_i2s_probe(struct platform_device *pdev)
return err;
}
- info->mclk = clk_get(&pdev->dev, "mclk");
- if (IS_ERR(info->mclk)) {
- err = PTR_ERR(info->mclk);
- goto fail;
- }
+ info->mclk = devm_clk_get(&pdev->dev, "mclk");
+ if (IS_ERR(info->mclk))
+ return PTR_ERR(info->mclk);
- info->sclk = clk_get(&pdev->dev, "sclk");
- if (IS_ERR(info->sclk)) {
- err = PTR_ERR(info->sclk);
- goto fail_put_mclk;
- }
+ info->sclk = devm_clk_get(&pdev->dev, "sclk");
+ if (IS_ERR(info->sclk))
+ return PTR_ERR(info->sclk);
- info->lrclk = clk_get(&pdev->dev, "lrclk");
- if (IS_ERR(info->lrclk)) {
- err = PTR_ERR(info->lrclk);
- goto fail_put_sclk;
- }
+ info->lrclk = devm_clk_get(&pdev->dev, "lrclk");
+ if (IS_ERR(info->lrclk))
+ return PTR_ERR(info->lrclk);
dev_set_drvdata(&pdev->dev, info);
err = devm_snd_soc_register_component(&pdev->dev, &ep93xx_i2s_component,
&ep93xx_i2s_dai, 1);
if (err)
- goto fail_put_lrclk;
+ return err;
err = devm_ep93xx_pcm_platform_register(&pdev->dev);
if (err)
- goto fail_put_lrclk;
+ return err;
return 0;
-
-fail_put_lrclk:
- clk_put(info->lrclk);
-fail_put_sclk:
- clk_put(info->sclk);
-fail_put_mclk:
- clk_put(info->mclk);
-fail:
- return err;
-}
-
-static void ep93xx_i2s_remove(struct platform_device *pdev)
-{
- struct ep93xx_i2s_info *info = dev_get_drvdata(&pdev->dev);
-
- clk_put(info->lrclk);
- clk_put(info->sclk);
- clk_put(info->mclk);
}
static const struct of_device_id ep93xx_i2s_of_ids[] = {
@@ -529,7 +505,6 @@ MODULE_DEVICE_TABLE(of, ep93xx_i2s_of_ids);
static struct platform_driver ep93xx_i2s_driver = {
.probe = ep93xx_i2s_probe,
- .remove = ep93xx_i2s_remove,
.driver = {
.name = "ep93xx-i2s",
.of_match_table = ep93xx_i2s_of_ids,
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-17 4:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 4:21 [PATCH 0/2] ASoC: cirrus: ep93xx-i2s: Clean up resource management phucduc.bui
2026-11-17 4:21 ` [PATCH 1/2] ASoC: cirrus: ep93xx-i2s: Simplify platform_get_irq() error check phucduc.bui
2026-11-17 4:21 ` [PATCH 2/2] ASoC: cirrus: ep93xx-i2s: Use devm_clk_get() phucduc.bui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox