Skip to content

Commit

Permalink
watchdog: rt2880_wdt: fix return value check in rt288x_wdt_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>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Wei Yongjun authored and Wim Van Sebroeck committed Nov 17, 2013
1 parent 6ffcff9 commit 0859ffc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/watchdog/rt2880_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static int rt288x_wdt_probe(struct platform_device *pdev)
int ret;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
rt288x_wdt_base = devm_request_and_ioremap(&pdev->dev, res);
rt288x_wdt_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(rt288x_wdt_base))
return PTR_ERR(rt288x_wdt_base);

Expand Down

0 comments on commit 0859ffc

Please sign in to comment.