mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: sunxi: sun50i-dmic: Add missing check for devm_regmap_init_mmio
@ 2026-01-27  3:32 Chen Ni
  2026-01-27 15:37 ` Markus Elfring
  2026-01-28  0:37 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Ni @ 2026-01-27  3:32 UTC (permalink / raw)
  To: fengzheng923, lgirdwood, broonie, perex, tiwai, wens,
	jernej.skrabec, samuel
  Cc: linux-sound, linux-arm-kernel, linux-sunxi, linux-kernel, Chen Ni

Add check for the return value of devm_regmap_init_mmio() and return the
error if it fails in order to catch the error.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 sound/soc/sunxi/sun50i-dmic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/sunxi/sun50i-dmic.c b/sound/soc/sunxi/sun50i-dmic.c
index bab1e29c9988..69d2478ffc95 100644
--- a/sound/soc/sunxi/sun50i-dmic.c
+++ b/sound/soc/sunxi/sun50i-dmic.c
@@ -358,6 +358,9 @@ static int sun50i_dmic_probe(struct platform_device *pdev)
 
 	host->regmap = devm_regmap_init_mmio(&pdev->dev, base,
 					     &sun50i_dmic_regmap_config);
+	if (IS_ERR(host->regmap))
+		return dev_err_probe(&pdev->dev, PTR_ERR(host->regmap),
+				     "failed to initialise regmap\n");
 
 	/* Clocks */
 	host->bus_clk = devm_clk_get(&pdev->dev, "bus");
-- 
2.25.1


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

end of thread, other threads:[~2026-01-28  0:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-27  3:32 [PATCH] ASoC: sunxi: sun50i-dmic: Add missing check for devm_regmap_init_mmio Chen Ni
2026-01-27 15:37 ` Markus Elfring
2026-01-28  0:37 ` Mark Brown

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

all inboxes | Powered by JetHome®