netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: mediatek: fix checking for NULL instead of IS_ERR() in .probe
@ 2016-03-22 23:06 Vladimir Zapolskiy
  2016-03-23  9:00 ` Matthias Brugger
  2016-03-23 17:50 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Vladimir Zapolskiy @ 2016-03-22 23:06 UTC (permalink / raw)
  To: David S. Miller, Felix Fietkau, John Crispin
  Cc: netdev, linux-arm-kernel, linux-mediatek

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>
---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++--
 1 file 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 7f2126b..e0b68af 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(&eth->page_lock);
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-23 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 23:06 [PATCH] net: mediatek: fix checking for NULL instead of IS_ERR() in .probe Vladimir Zapolskiy
2016-03-23  9:00 ` Matthias Brugger
2016-03-23  9:07   ` John Crispin
2016-03-23 17:50 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).