MIPS: ralink: fix return value check in rt_timer_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 31 Oct 2013 07:51:38 +0000 (15:51 +0800)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 31 Oct 2013 11:38:34 +0000 (12:38 +0100)
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>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: grant.likely@linaro.org
Cc: rob.herring@calxeda.com
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/6098/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/ralink/timer.c

index e49241a2c39a3b4d359f8d77eb6063f26ea89be0..202785709441c0a704b7cf1110e151834e9219c3 100644 (file)
@@ -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);