watchdog: rt2880_wdt: fix return value check in rt288x_wdt_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 31 Oct 2013 07:50:55 +0000 (15:50 +0800)
committerWim Van Sebroeck <wim@iguana.be>
Sun, 17 Nov 2013 18:38:44 +0000 (19: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>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/rt2880_wdt.c

index a9f84919df7f8b9031484503b8cc8fdd6dde6dce..53d37fea183e1b5be5f2f18093a1c4021e632bc9 100644 (file)
@@ -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);