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

ASoC: Convert to devm_ioremap_resource()

Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Thierry Reding and committed by
Greg Kroah-Hartman
b25b5aa0 4d6dc3a7

+25 -29
+4 -3
sound/soc/cirrus/ep93xx-ac97.c
··· 11 11 */ 12 12 13 13 #include <linux/delay.h> 14 + #include <linux/err.h> 14 15 #include <linux/io.h> 15 16 #include <linux/init.h> 16 17 #include <linux/module.h> ··· 368 367 if (!res) 369 368 return -ENODEV; 370 369 371 - info->regs = devm_request_and_ioremap(&pdev->dev, res); 372 - if (!info->regs) 373 - return -ENXIO; 370 + info->regs = devm_ioremap_resource(&pdev->dev, res); 371 + if (IS_ERR(info->regs)) 372 + return PTR_ERR(info->regs); 374 373 375 374 irq = platform_get_irq(pdev, 0); 376 375 if (!irq)
+3 -3
sound/soc/cirrus/ep93xx-i2s.c
··· 380 380 if (!res) 381 381 return -ENODEV; 382 382 383 - info->regs = devm_request_and_ioremap(&pdev->dev, res); 384 - if (!info->regs) 385 - return -ENXIO; 383 + info->regs = devm_ioremap_resource(&pdev->dev, res); 384 + if (IS_ERR(info->regs)) 385 + return PTR_ERR(info->regs); 386 386 387 387 info->mclk = clk_get(&pdev->dev, "mclk"); 388 388 if (IS_ERR(info->mclk)) {
+3 -3
sound/soc/codecs/jz4740.c
··· 361 361 return -ENOMEM; 362 362 363 363 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 364 - base = devm_request_and_ioremap(&pdev->dev, mem); 365 - if (!base) 366 - return -EBUSY; 364 + base = devm_ioremap_resource(&pdev->dev, mem); 365 + if (IS_ERR(base)) 366 + return PTR_ERR(base); 367 367 368 368 jz4740_codec->regmap = devm_regmap_init_mmio(&pdev->dev, base, 369 369 &jz4740_codec_regmap_config);
+3 -3
sound/soc/fsl/imx-audmux.c
··· 252 252 of_match_device(imx_audmux_dt_ids, &pdev->dev); 253 253 254 254 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 255 - audmux_base = devm_request_and_ioremap(&pdev->dev, res); 256 - if (!audmux_base) 257 - return -EADDRNOTAVAIL; 255 + audmux_base = devm_ioremap_resource(&pdev->dev, res); 256 + if (IS_ERR(audmux_base)) 257 + return PTR_ERR(audmux_base); 258 258 259 259 pinctrl = devm_pinctrl_get_select_default(&pdev->dev); 260 260 if (IS_ERR(pinctrl)) {
+3 -4
sound/soc/fsl/imx-ssi.c
··· 550 550 goto failed_get_resource; 551 551 } 552 552 553 - ssi->base = devm_request_and_ioremap(&pdev->dev, res); 554 - if (!ssi->base) { 555 - dev_err(&pdev->dev, "ioremap failed\n"); 556 - ret = -ENODEV; 553 + ssi->base = devm_ioremap_resource(&pdev->dev, res); 554 + if (IS_ERR(ssi->base)) { 555 + ret = PTR_ERR(ssi->base); 557 556 goto failed_register; 558 557 } 559 558
+3 -5
sound/soc/kirkwood/kirkwood-i2s.c
··· 472 472 return -ENXIO; 473 473 } 474 474 475 - priv->io = devm_request_and_ioremap(&pdev->dev, mem); 476 - if (!priv->io) { 477 - dev_err(&pdev->dev, "devm_request_and_ioremap failed\n"); 478 - return -ENOMEM; 479 - } 475 + priv->io = devm_ioremap_resource(&pdev->dev, mem); 476 + if (IS_ERR(priv->io)) 477 + return PTR_ERR(priv->io); 480 478 481 479 priv->irq = platform_get_irq(pdev, 0); 482 480 if (priv->irq <= 0) {
+3 -5
sound/soc/mxs/mxs-saif.c
··· 724 724 725 725 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); 726 726 727 - saif->base = devm_request_and_ioremap(&pdev->dev, iores); 728 - if (!saif->base) { 729 - dev_err(&pdev->dev, "ioremap failed\n"); 730 - return -ENODEV; 731 - } 727 + saif->base = devm_ioremap_resource(&pdev->dev, iores); 728 + if (IS_ERR(saif->base)) 729 + return PTR_ERR(saif->base); 732 730 733 731 dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0); 734 732 if (!dmares) {
+3 -3
sound/soc/pxa/mmp-sspa.c
··· 429 429 if (res == NULL) 430 430 return -ENOMEM; 431 431 432 - priv->sspa->mmio_base = devm_request_and_ioremap(&pdev->dev, res); 433 - if (priv->sspa->mmio_base == NULL) 434 - return -ENODEV; 432 + priv->sspa->mmio_base = devm_ioremap_resource(&pdev->dev, res); 433 + if (IS_ERR(priv->sspa->mmio_base)) 434 + return PTR_ERR(priv->sspa->mmio_base); 435 435 436 436 priv->sspa->clk = devm_clk_get(&pdev->dev, NULL); 437 437 if (IS_ERR(priv->sspa->clk))