netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: davem@davemloft.net
Cc: kernel@pengutronix.de, Frank.Li@freescale.com,
	shawn.guo@linaro.org, netdev@vger.kernel.org,
	Fabio Estevam <fabio.estevam@freescale.com>
Subject: [PATCH 5/6] fec: Remove unneeded check in platform_get_resource()
Date: Sun, 21 Jul 2013 13:25:03 -0300	[thread overview]
Message-ID: <1374423904-2668-6-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1374423904-2668-1-git-send-email-festevam@gmail.com>

From: Fabio Estevam <fabio.estevam@freescale.com>

As devm_ioremap_resource() is used, there is no need to explicitely check the
return value from platform_get_resource(), as this is something that
devm_ioremap_resource() takes care by itself.

Also, place platform_get_resource() prior to devm_ioremap_resource() for
better code readability.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index acc1850..03028c4 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2033,10 +2033,6 @@ fec_probe(struct platform_device *pdev)
 	if (of_id)
 		pdev->id_entry = of_id->data;
 
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!r)
-		return -ENXIO;
-
 	/* Init network device */
 	ndev = alloc_etherdev(sizeof(struct fec_enet_private));
 	if (!ndev)
@@ -2054,6 +2050,7 @@ fec_probe(struct platform_device *pdev)
 		fep->pause_flag |= FEC_PAUSE_FLAG_AUTONEG;
 #endif
 
+	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	fep->hwp = devm_ioremap_resource(&pdev->dev, r);
 	if (IS_ERR(fep->hwp)) {
 		ret = PTR_ERR(fep->hwp);
-- 
1.8.1.2

  parent reply	other threads:[~2013-07-21 16:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-21 16:24 [PATCH 0/6] fec: Improve resources handling Fabio Estevam
2013-07-21 16:24 ` [PATCH 1/6] fec: Do not enable/disable optional clocks unconditionally Fabio Estevam
2013-07-21 16:25 ` [PATCH 2/6] fec: Fix the order for enabling/disabling the clocks Fabio Estevam
2013-07-21 16:25 ` [PATCH 3/6] fec: Enable/disable clk_ptp in suspend/resume Fabio Estevam
2013-07-21 16:25 ` [PATCH 4/6] fec: Check the return value from clk_prepare_enable() Fabio Estevam
2013-07-21 16:25 ` Fabio Estevam [this message]
2013-07-21 16:25 ` [PATCH 6/6] fec: Use devm_request_irq() Fabio Estevam
2013-07-22  4:21 ` [PATCH 0/6] fec: Improve resources handling Frank Li
2013-07-22 23:51   ` 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=1374423904-2668-6-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=Frank.Li@freescale.com \
    --cc=davem@davemloft.net \
    --cc=fabio.estevam@freescale.com \
    --cc=kernel@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=shawn.guo@linaro.org \
    --subject='Re: [PATCH 5/6] fec: Remove unneeded check in platform_get_resource()' \
    /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

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).