From: Varka Bhadram <varkabhadram@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, sergei.shtylyov@cogentembedded.com,
Varka Bhadram <varkab@cdac.in>
Subject: [PATCH net-next v3 3/5] ethernet: marvell: remove unnecessary check
Date: Fri, 24 Oct 2014 07:42:08 +0530 [thread overview]
Message-ID: <1414116730-4590-4-git-send-email-varkab@cdac.in> (raw)
In-Reply-To: <1414116730-4590-1-git-send-email-varkab@cdac.in>
devm_ioremap_resource checks platform_get_resource() return value.
We can remove the duplicate check here.
Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
drivers/net/ethernet/marvell/pxa168_eth.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index c3b209c..a378c92 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1505,16 +1505,14 @@ static int pxa168_eth_probe(struct platform_device *pdev)
pep = netdev_priv(dev);
pep->dev = dev;
pep->clk = clk;
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (res == NULL) {
- err = -ENODEV;
- goto err_netdev;
- }
pep->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(pep->base)) {
err = -ENOMEM;
goto err_netdev;
}
+
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
BUG_ON(!res);
dev->irq = res->start;
--
1.7.9.5
next prev parent reply other threads:[~2014-10-24 2:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 2:12 [PATCH net-next v3 0/5] cleanup on resource check Varka Bhadram
2014-10-24 2:12 ` [PATCH net-next v3 1/5] ethernet: wiznet: remove unnecessary check Varka Bhadram
2014-10-24 2:12 ` [PATCH net-next v3 2/5] ethernet: apm: xgene: " Varka Bhadram
2014-10-24 2:12 ` Varka Bhadram [this message]
2014-10-24 2:12 ` [PATCH net-next v3 4/5] ethernet: renesas: " Varka Bhadram
2014-10-24 2:12 ` [PATCH net-next v3 5/5] ethernet: samsung: sxgbe: " Varka Bhadram
2014-10-27 23:16 ` [PATCH net-next v3 0/5] cleanup on resource check 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=1414116730-4590-4-git-send-email-varkab@cdac.in \
--to=varkabhadram@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=varkab@cdac.in \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).