video: fbdev: imxfb: fix return value check in imxfb_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 29 Jul 2022 02:41:34 +0000 (10:41 +0800)
committerHelge Deller <deller@gmx.de>
Fri, 29 Jul 2022 20:59:05 +0000 (22:59 +0200)
If devm_ioremap_resource() fails, it never return NULL, replace
NULL test with IS_ERR().

Fixes: b083c22d5114 ("video: fbdev: imxfb: Convert request_mem_region + ioremap to devm_ioremap_resource")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/imxfb.c

index c48477893dd0631bbca1eaa016ab5bd52affd4d5..d97d7456d15a0b6eafd92be10787d5d5da436873 100644 (file)
@@ -971,9 +971,9 @@ static int imxfb_probe(struct platform_device *pdev)
        }
 
        fbi->regs = devm_ioremap_resource(&pdev->dev, res);
-       if (fbi->regs == NULL) {
+       if (IS_ERR(fbi->regs)) {
                dev_err(&pdev->dev, "Cannot map frame buffer registers\n");
-               ret = -ENOMEM;
+               ret = PTR_ERR(fbi->regs);
                goto failed_ioremap;
        }