projects/linux·commit cd5d5810

MIPS: ralink: fix return value check in rt_timer_probe()

cd5d5810 · Wei Yongjun <[email protected]> · 2013-10-31 15:51:38 +08:00

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 <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/6098/
Signed-off-by: Ralf Baechle <[email protected]>
Commit
cd5d58108e41b0edecc1e7a6468cbe06ce03be3f
Parents
13b7ea63

Changes

1 files changed · +1 −1

FileStatusAddDelContent
arch/mips/ralink/timer.cmodified+1−1View file

arch/mips/ralink/timer.c

View file
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);