aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorYang Yingliang2022-07-29 10:41:34 +0800
committerHelge Deller2022-07-29 22:59:05 +0200
commitc5c7502e960d9128eae1a5663fb62506d8685ac3 (patch)
tree4ac4333c953953f757e477cd844e5b494eb13b38 /drivers/video/fbdev
parent3eb8fccc244bfb41a7961969e4db280d44911226 (diff)
video: fbdev: imxfb: fix return value check in imxfb_probe()
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>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/imxfb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index c48477893dd0..d97d7456d15a 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -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;
}