Skip to content

Commit

Permalink
video: fbdev: imxfb: fix return value check in imxfb_probe()
Browse files Browse the repository at this point in the history
If devm_ioremap_resource() fails, it never return NULL, replace
NULL test with IS_ERR().

Fixes: b083c22 ("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>
  • Loading branch information
Yang Yingliang authored and hdeller committed Jul 29, 2022
1 parent 3eb8fcc commit c5c7502
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/video/fbdev/imxfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c5c7502

Please sign in to comment.