diff options
author | Thierry Reding <thierry.reding@avionic-design.de> | 2013-01-21 11:09:12 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-25 12:21:47 -0800 |
commit | b0de774c6334dccdcd43a7ef46155a1f3a52a954 (patch) | |
tree | d845a8ea2c8f5d556591829ec1829f216ad0cbb1 /drivers/mtd/nand/fsmc_nand.c | |
parent | a3e2cd7f24ba7521169943ace3d14b567487ea29 (diff) |
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 <thierry.reding@avionic-design.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mtd/nand/fsmc_nand.c')
-rw-r--r-- | drivers/mtd/nand/fsmc_nand.c | 33 |
1 files changed, 13 insertions, 20 deletions
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)) { |