linux-mips
[Top] [All Lists]

[PATCH] pci: use newly introduced devm_ioremap_resource()

To: linux-mips@linux-mips.org
Subject: [PATCH] pci: use newly introduced devm_ioremap_resource()
From: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Date: Mon, 11 Mar 2013 17:24:37 +0200
Cc: ralf@linux-mips.org, juhosg@openwrt.org, blogic@openwrt.org, kaloz@openwrt.org, linux-kernel@vger.kernel.org, Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=0ouuIq4BJ3NCSJhyYrbJHSvcI6Zap1PVamdS6KOCvQg=; b=WH1HcKyGrPY4noLZjS7wFG29yStScf/0Sj4dN7PRXHyuRRCQRDq8QLPE+984RWsTsQ mbUeFrt8LvDQh59GC92RdMt1qZH25L0njRlJ0IDr0wq7KPXFxZ10j4j6OuOmTEvzSTVt qWX3Ns+QiSo5JkXhA1t36/X86btcpkpB8U6DAzOM7+LowcbrWatnHilOcEK+puIG0OrA lf6qh361KePThd+xMB8s13dl/q2XT4EMd00qN6F98hD2Yl3SGNhI0tA9rR5RRW/Vka4n q1KhMtL3juY3UeFFzv9uQe5etK3Lvd4R4vztpjhomhmWBqIZCC6Bmyw/yEgDfTW/NM1d Dd6w==
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Sender: linux-mips-bounce@linux-mips.org
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: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
---
 arch/mips/pci/pci-ar71xx.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/mips/pci/pci-ar71xx.c b/arch/mips/pci/pci-ar71xx.c
index 412ec02..18517dd 100644
--- a/arch/mips/pci/pci-ar71xx.c
+++ b/arch/mips/pci/pci-ar71xx.c
@@ -366,9 +366,9 @@ static int ar71xx_pci_probe(struct platform_device *pdev)
        if (!res)
                return -EINVAL;
 
-       apc->cfg_base = devm_request_and_ioremap(&pdev->dev, res);
-       if (!apc->cfg_base)
-               return -ENOMEM;
+       apc->cfg_base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(apc->cfg_base))
+               return PTR_ERR(apc->cfg_base);
 
        apc->irq = platform_get_irq(pdev, 0);
        if (apc->irq < 0)
-- 
1.7.9.5


<Prev in Thread] Current Thread [Next in Thread>