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: 25e95d7631 ("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
24ec03cc55
commit
5edb7338d6
@@ -128,8 +128,8 @@ static int loongson_uart_probe(struct platform_device *pdev)
|
||||
port->private_data = priv;
|
||||
|
||||
port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &priv->res);
|
||||
if (!port->membase)
|
||||
return -ENOMEM;
|
||||
if (IS_ERR(port->membase))
|
||||
return PTR_ERR(port->membase);
|
||||
|
||||
port->mapbase = priv->res->start;
|
||||
port->mapsize = resource_size(priv->res);
|
||||
|
||||
Reference in New Issue
Block a user