Skip to content

Commit 5edb733

Browse files
Dan Carpentergregkh
authored andcommitted
serial: 8250: longson: Fix NULL vs IS_ERR() bug in probe
The devm_platform_get_and_ioremap_resource() function never returns NULL, it returns error pointers. Fix the error checking to match. Fixes: 25e95d7 ("serial: 8250: Add Loongson uart driver support") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/aSsIa3KdAlXh5uQC@stanley.mountain Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 24ec03c commit 5edb733

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/tty/serial/8250/8250_loongson.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ static int loongson_uart_probe(struct platform_device *pdev)
128128
port->private_data = priv;
129129

130130
port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &priv->res);
131-
if (!port->membase)
132-
return -ENOMEM;
131+
if (IS_ERR(port->membase))
132+
return PTR_ERR(port->membase);
133133

134134
port->mapbase = priv->res->start;
135135
port->mapsize = resource_size(priv->res);

0 commit comments

Comments
 (0)