Skip to content

Commit

Permalink
MIPS: ralink: fix return value check in rt_timer_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Ralf Baechle committed Oct 31, 2013
1 parent 13b7ea6 commit cd5d581
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/mips/ralink/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit cd5d581

Please sign in to comment.