Unverified Commit 97b19db1 authored by Yangtao Li's avatar Yangtao Li Committed by Mark Brown
Browse files

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: default avatarYangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230711034846.69437-4-frank.li@vivo.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e1537b59
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -370,18 +370,11 @@ static const struct snd_soc_component_driver pxa_i2s_component = {

static int pxa2xx_i2s_drv_probe(struct platform_device *pdev)
{
	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	struct resource *res;

	if (!res) {
		dev_err(&pdev->dev, "missing MMIO resource\n");
		return -ENXIO;
	}

	i2s_reg_base = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(i2s_reg_base)) {
		dev_err(&pdev->dev, "ioremap failed\n");
	i2s_reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
	if (IS_ERR(i2s_reg_base))
		return PTR_ERR(i2s_reg_base);
	}

	pxa2xx_i2s_pcm_stereo_out.addr = res->start + SADR;
	pxa2xx_i2s_pcm_stereo_in.addr = res->start + SADR;