diff mbox series

[-next] video: fbdev: imxfb: fix return value check in imxfb_probe()

Message ID 20220729024134.159942-1-yangyingliang@huawei.com
State New
Headers show
Series [-next] video: fbdev: imxfb: fix return value check in imxfb_probe() | expand

Commit Message

Yang Yingliang July 29, 2022, 2:41 a.m. UTC
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>
---
 drivers/video/fbdev/imxfb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Helge Deller July 29, 2022, 8:59 p.m. UTC | #1
On 7/29/22 04:41, Yang Yingliang wrote:
> 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>

applied to fbdev git tree.

Thanks!
Helge

> ---
>  drivers/video/fbdev/imxfb.c | 4 ++--
>  1 file 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;
>  	}
>
diff mbox series

Patch

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;
 	}