From b0de774c6334dccdcd43a7ef46155a1f3a52a954 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 21 Jan 2013 11:09:12 +0100 Subject: mtd: 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 Cc: David Woodhouse Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/fsmc_nand.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'drivers/mtd/nand/fsmc_nand.c') diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c index 67e62d3d495..c543cc09f19 100644 --- a/drivers/mtd/nand/fsmc_nand.c +++ b/drivers/mtd/nand/fsmc_nand.c @@ -937,42 +937,35 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) if (!res) return -EINVAL; - host->data_va = devm_request_and_ioremap(&pdev->dev, res); - if (!host->data_va) { - dev_err(&pdev->dev, "data ioremap failed\n"); - return -ENOMEM; - } + host->data_va = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(host->data_va)) + return PTR_ERR(host->data_va); + host->data_pa = (dma_addr_t)res->start; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_addr"); if (!res) return -EINVAL; - host->addr_va = devm_request_and_ioremap(&pdev->dev, res); - if (!host->addr_va) { - dev_err(&pdev->dev, "ale ioremap failed\n"); - return -ENOMEM; - } + host->addr_va = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(host->addr_va)) + return PTR_ERR(host->addr_va); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_cmd"); if (!res) return -EINVAL; - host->cmd_va = devm_request_and_ioremap(&pdev->dev, res); - if (!host->cmd_va) { - dev_err(&pdev->dev, "ale ioremap failed\n"); - return -ENOMEM; - } + host->cmd_va = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(host->cmd_va)) + return PTR_ERR(host->cmd_va); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fsmc_regs"); if (!res) return -EINVAL; - host->regs_va = devm_request_and_ioremap(&pdev->dev, res); - if (!host->regs_va) { - dev_err(&pdev->dev, "regs ioremap failed\n"); - return -ENOMEM; - } + host->regs_va = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(host->regs_va)) + return PTR_ERR(host->regs_va); host->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(host->clk)) { -- cgit v1.2.3-70-g09d2