* [PATCH -next] drm/pl111: Fix return value check in pl111_amba_probe()
@ 2017-05-21 1:01 Wei Yongjun
2017-05-22 22:11 ` Eric Anholt
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2017-05-21 1:01 UTC (permalink / raw)
To: Eric Anholt, David Airlie, Tom Cooksey
Cc: Wei Yongjun, dri-devel, linux-kernel
From: Wei Yongjun <weiyongjun1@huawei.com>
In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().
Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index 936403f..c6b93ff 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -203,9 +203,9 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
}
priv->regs = devm_ioremap_resource(dev, &amba_dev->res);
- if (!priv->regs) {
+ if (IS_ERR(priv->regs)) {
dev_err(dev, "%s failed mmio\n", __func__);
- return -EINVAL;
+ return PTR_ERR(priv->regs);
}
/* turn off interrupts before requesting the irq */
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] drm/pl111: Fix return value check in pl111_amba_probe()
2017-05-21 1:01 [PATCH -next] drm/pl111: Fix return value check in pl111_amba_probe() Wei Yongjun
@ 2017-05-22 22:11 ` Eric Anholt
0 siblings, 0 replies; 2+ messages in thread
From: Eric Anholt @ 2017-05-22 22:11 UTC (permalink / raw)
To: Wei Yongjun, David Airlie, Tom Cooksey
Cc: Wei Yongjun, dri-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 424 bytes --]
Wei Yongjun <weiyj.lk@gmail.com> writes:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> In case of error, the function devm_ioremap_resource() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
>
> Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed and applied. Thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-22 22:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-21 1:01 [PATCH -next] drm/pl111: Fix return value check in pl111_amba_probe() Wei Yongjun
2017-05-22 22:11 ` Eric Anholt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).