From: Vladimir Zapolskiy <vz@mleia.com> To: "David S. Miller" <davem@davemloft.net>, Felix Fietkau <nbd@openwrt.org>, John Crispin <blogic@openwrt.org> Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH] net: mediatek: fix checking for NULL instead of IS_ERR() in .probe Date: Wed, 23 Mar 2016 01:06:04 +0200 [thread overview] Message-ID: <1458687964-9690-1-git-send-email-vz@mleia.com> (raw) 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(ð->page_lock); -- 2.1.4
WARNING: multiple messages have this Message-ID (diff)
From: vz@mleia.com (Vladimir Zapolskiy) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] net: mediatek: fix checking for NULL instead of IS_ERR() in .probe Date: Wed, 23 Mar 2016 01:06:04 +0200 [thread overview] Message-ID: <1458687964-9690-1-git-send-email-vz@mleia.com> (raw) 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(ð->page_lock); -- 2.1.4
next reply other threads:[~2016-03-22 23:06 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-03-22 23:06 Vladimir Zapolskiy [this message] 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:00 ` Matthias Brugger 2016-03-23 9:07 ` John Crispin 2016-03-23 9:07 ` John Crispin 2016-03-23 17:50 ` David Miller 2016-03-23 17:50 ` David Miller
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1458687964-9690-1-git-send-email-vz@mleia.com \ --to=vz@mleia.com \ --cc=blogic@openwrt.org \ --cc=davem@davemloft.net \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-mediatek@lists.infradead.org \ --cc=nbd@openwrt.org \ --cc=netdev@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.