Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: pxa: Use devm_platform_get_and_ioremap_resource()

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.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230711034846.69437-4-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Yangtao Li and committed by
Mark Brown
97b19db1 e1537b59

+3 -10
+3 -10
sound/soc/pxa/pxa2xx-i2s.c
··· 370 370 371 371 static int pxa2xx_i2s_drv_probe(struct platform_device *pdev) 372 372 { 373 - struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 373 + struct resource *res; 374 374 375 - if (!res) { 376 - dev_err(&pdev->dev, "missing MMIO resource\n"); 377 - return -ENXIO; 378 - } 379 - 380 - i2s_reg_base = devm_ioremap_resource(&pdev->dev, res); 381 - if (IS_ERR(i2s_reg_base)) { 382 - dev_err(&pdev->dev, "ioremap failed\n"); 375 + i2s_reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); 376 + if (IS_ERR(i2s_reg_base)) 383 377 return PTR_ERR(i2s_reg_base); 384 - } 385 378 386 379 pxa2xx_i2s_pcm_stereo_out.addr = res->start + SADR; 387 380 pxa2xx_i2s_pcm_stereo_in.addr = res->start + SADR;