diff options
author | Vladimir Zapolskiy <vz@mleia.com> | 2016-03-23 01:06:04 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-23 13:49:13 -0400 |
commit | 621e49f6d80a731dd3073569571c4579352cfb1c (patch) | |
tree | f88f2e2fe58586be64818bad1ac7c9d9f2724060 /drivers/net/ethernet/mediatek | |
parent | 9eb13f65c305ec6687d7666abce14e6c047fa872 (diff) | |
download | talos-obmc-linux-621e49f6d80a731dd3073569571c4579352cfb1c.tar.gz talos-obmc-linux-621e49f6d80a731dd3073569571c4579352cfb1c.zip |
net: mediatek: fix checking for NULL instead of IS_ERR() in .probe
devm_ioremap_resource() returns ERR_PTR() value on error, it never
returns NULL, fix it and propagate the returned error upwards.
Fixes: 656e705243fd ("net-next: mediatek: add support for MT7623 ethernet")
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Acked-by: John Crispin <blogic@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mediatek')
-rw-r--r-- | drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 7f2126b6a179..e0b68afea56e 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1690,8 +1690,8 @@ static int mtk_probe(struct platform_device *pdev) return -ENOMEM; eth->base = devm_ioremap_resource(&pdev->dev, res); - if (!eth->base) - return -EADDRNOTAVAIL; + if (IS_ERR(eth->base)) + return PTR_ERR(eth->base); spin_lock_init(ð->page_lock); |