All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: sunxi: use devm_platform_get_and_ioremap_resource()
@ 2022-11-11  8:41 ` ye.xingchen
  0 siblings, 0 replies; 9+ messages in thread
From: ye.xingchen @ 2022-11-11  8:41 UTC (permalink / raw)
  To: fengzheng923
  Cc: alsa-devel, linux-kernel, chi.minghao, lgirdwood, broonie,
	linux-sunxi, linux-arm-kernel

From: Minghao Chi <chi.minghao@zte.com.cn>

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 sound/soc/sunxi/sun50i-dmic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/sunxi/sun50i-dmic.c b/sound/soc/sunxi/sun50i-dmic.c
index 62509cb02995..069c993acb31 100644
--- a/sound/soc/sunxi/sun50i-dmic.c
+++ b/sound/soc/sunxi/sun50i-dmic.c
@@ -317,8 +317,7 @@ static int sun50i_dmic_probe(struct platform_device *pdev)
 		return -ENOMEM;

 	/* Get the addresses */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(base))
 		return dev_err_probe(&pdev->dev, PTR_ERR(base),
 				     "get resource failed.\n");
-- 
2.25.1

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

end of thread, other threads:[~2022-11-15 10:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-11  8:41 [PATCH] ASoC: sunxi: use devm_platform_get_and_ioremap_resource() ye.xingchen
2022-11-11  8:41 ` ye.xingchen
2022-11-11  8:41 ` ye.xingchen
2022-11-13 21:28 ` Samuel Holland
2022-11-13 21:28   ` Samuel Holland
2022-11-13 21:28   ` Samuel Holland
2022-11-15  9:56 ` Mark Brown
2022-11-15  9:56   ` Mark Brown
2022-11-15  9:56   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.