diff mbox

drm/tve200: Check for IS_ERR instead of NULL in probe

Message ID 20170925102520.a7spymwqqbsczzz2@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Sept. 25, 2017, 10:25 a.m. UTC
devm_ioremap_resource() returns error pointer, it never returns NULL on
error.

Fixes: 179c02fe90a4 ("drm/tve200: Add new driver for TVE200")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Linus Walleij Sept. 25, 2017, 3:33 p.m. UTC | #1
On Mon, Sep 25, 2017 at 12:25 PM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:

> devm_ioremap_resource() returns error pointer, it never returns NULL on
> error.
>
> Fixes: 179c02fe90a4 ("drm/tve200: Add new driver for TVE200")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

I am travelling right now but will apply the patch on monday in
one week from now.

Yours,
Linus Walleij
Linus Walleij Sept. 30, 2017, 11:32 p.m. UTC | #2
On Mon, Sep 25, 2017 at 12:25 PM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:

> devm_ioremap_resource() returns error pointer, it never returns NULL on
> error.
>
> Fixes: 179c02fe90a4 ("drm/tve200: Add new driver for TVE200")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Patch applied.

Yours,
Linus Walleij
diff mbox

Patch

diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
index eae38b669f0a..6939f7455a2d 100644
--- a/drivers/gpu/drm/tve200/tve200_drv.c
+++ b/drivers/gpu/drm/tve200/tve200_drv.c
@@ -225,7 +225,7 @@  static int tve200_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	priv->regs = devm_ioremap_resource(dev, res);
-	if (!priv->regs) {
+	if (IS_ERR(priv->regs)) {
 		dev_err(dev, "%s failed mmio\n", __func__);
 		ret = -EINVAL;
 		goto clk_disable;