linux-mips
[Top] [All Lists]

[PATCH] MIPS: ralink: fix return value check in rt_timer_probe()

To: ralf@linux-mips.org, grant.likely@linaro.org, rob.herring@calxeda.com, blogic@openwrt.org
Subject: [PATCH] MIPS: ralink: fix return value check in rt_timer_probe()
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Thu, 31 Oct 2013 15:51:38 +0800
Cc: yongjun_wei@trendmicro.com.cn, linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=xQnsCKvFaqJElzBYuouDOZKHCG4xmUOXkrlbXvilXLc=; b=i9rBDRvN4PaGkMKK/7viNbQWgtdGRbqBN1524FvokkHYrsVeo3nXeNzGm/xOizP86H fwOQ58F9tMGPr+ImYJacmhRfJ8IZb06resSkITBWepSHXhrFyvNvDRdHf2lCDKJspUTM /CgbOHSGHkR5SLv9yGfjnPQ5LV8uAImEh9vs0pVmJPCy39/1fJ4zP3K7Rc3mWbjGWXYR 3JaCbhqIp4cl8oR2Mmaw82SEY2VY3X9VmL8xiYfmI9Y26QrrgjxxK3n5KgkmWr4xdACz dcEDtOTU1g5vTJxcs4y56wqFVtUr6G61ZrD2nQ2VXUDHoyT3CIGUD3JlprTMa7sPfl6o 37/g==
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>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function devm_request_and_ioremap() returns NULL
pointer not ERR_PTR(). Fix it by using devm_ioremap_resource() instead
of devm_request_and_ioremap().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 arch/mips/ralink/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/ralink/timer.c b/arch/mips/ralink/timer.c
index e49241a..2027857 100644
--- a/arch/mips/ralink/timer.c
+++ b/arch/mips/ralink/timer.c
@@ -126,7 +126,7 @@ static int rt_timer_probe(struct platform_device *pdev)
                return -ENOENT;
        }
 
-       rt->membase = devm_request_and_ioremap(&pdev->dev, res);
+       rt->membase = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(rt->membase))
                return PTR_ERR(rt->membase);
 


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