Commit 4aef0eac authored by Dan Carpenter's avatar Dan Carpenter Committed by Kamal Mostafa

net: moxa: fix an error code

commit 1d3cd177 upstream.

We accidentally return IS_ERR(priv->base) which is 1 instead of
PTR_ERR(priv->base) which is the error code.

Fixes: 6c821bd9 ('net: Add MOXA ART SoCs ethernet driver')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent e98b77f8
...@@ -460,9 +460,9 @@ static int moxart_mac_probe(struct platform_device *pdev) ...@@ -460,9 +460,9 @@ static int moxart_mac_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ndev->base_addr = res->start; ndev->base_addr = res->start;
priv->base = devm_ioremap_resource(p_dev, res); priv->base = devm_ioremap_resource(p_dev, res);
ret = IS_ERR(priv->base); if (IS_ERR(priv->base)) {
if (ret) {
dev_err(p_dev, "devm_ioremap_resource failed\n"); dev_err(p_dev, "devm_ioremap_resource failed\n");
ret = PTR_ERR(priv->base);
goto init_fail; goto init_fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment