mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] ASoC: tegra: use devm_platform_ioremap_resource() to simplify code
@ 2019-09-04  8:39 YueHaibing
  2019-09-04 17:53 ` Applied "ASoC: tegra: use devm_platform_ioremap_resource() to simplify code" to the asoc tree Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: YueHaibing @ 2019-09-04  8:39 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, thierry.reding, jonathanh,
	yuehaibing, alexios.zavras, gregkh, rfontana, tglx
  Cc: alsa-devel, linux-tegra, linux-kernel

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 sound/soc/tegra/tegra30_ahub.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c
index 9523812..635eacb 100644
--- a/sound/soc/tegra/tegra30_ahub.c
+++ b/sound/soc/tegra/tegra30_ahub.c
@@ -511,7 +511,7 @@ static int tegra30_ahub_probe(struct platform_device *pdev)
 	const struct tegra30_ahub_soc_data *soc_data;
 	struct reset_control *rst;
 	int i;
-	struct resource *res0, *res1;
+	struct resource *res0;
 	void __iomem *regs_apbif, *regs_ahub;
 	int ret = 0;
 
@@ -587,8 +587,7 @@ static int tegra30_ahub_probe(struct platform_device *pdev)
 	}
 	regcache_cache_only(ahub->regmap_apbif, true);
 
-	res1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	regs_ahub = devm_ioremap_resource(&pdev->dev, res1);
+	regs_ahub = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(regs_ahub))
 		return PTR_ERR(regs_ahub);
 
-- 
2.7.4



^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH -next 02/34] ASoC: tegra: use devm_platform_ioremap_resource() to simplify code
@ 2019-07-27 15:07 YueHaibing
  2019-07-31 11:29 ` Applied "ASoC: tegra: use devm_platform_ioremap_resource() to simplify code" to the asoc tree Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: YueHaibing @ 2019-07-27 15:07 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, eric, wahrenst, f.fainelli,
	rjui, sbranden, bcm-kernel-feedback-list, paul, timur,
	nicoleotsuka, Xiubo.Lee, festevam, shawnguo, s.hauer, kernel,
	linux-imx, matthias.bgg, jbrunet, khilman, daniel,
	haojian.zhuang, robert.jarzmik, baohua, olivier.moysan,
	arnaud.pouliquen, mcoquelin.stm32, alexandre.torgue, mripard,
	wens, thierry.reding, jonathanh, yamada.masahiro, michal.simek,
	jcmvbkbc
  Cc: linux-kernel, alsa-devel, linux-rpi-kernel, linux-arm-kernel,
	linuxppc-dev, linux-mediatek, linux-amlogic, linux-stm32,
	linux-tegra, linux-xtensa, gregkh, YueHaibing

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 sound/soc/tegra/tegra30_i2s.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index ac6983c..e6d548f 100644
--- a/sound/soc/tegra/tegra30_i2s.c
+++ b/sound/soc/tegra/tegra30_i2s.c
@@ -368,7 +368,6 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
 	struct tegra30_i2s *i2s;
 	const struct of_device_id *match;
 	u32 cif_ids[2];
-	struct resource *mem;
 	void __iomem *regs;
 	int ret;
 
@@ -406,8 +405,7 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
 		goto err;
 	}
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	regs = devm_ioremap_resource(&pdev->dev, mem);
+	regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(regs)) {
 		ret = PTR_ERR(regs);
 		goto err_clk_put;
-- 
2.7.4



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

end of thread, other threads:[~2019-09-04 17:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04  8:39 [PATCH -next] ASoC: tegra: use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-09-04 17:53 ` Applied "ASoC: tegra: use devm_platform_ioremap_resource() to simplify code" to the asoc tree Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2019-07-27 15:07 [PATCH -next 02/34] ASoC: tegra: use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-07-31 11:29 ` Applied "ASoC: tegra: use devm_platform_ioremap_resource() to simplify code" to the asoc tree 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®