netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] net/fec: replace hardcoded irq num with macro
@ 2011-09-29 12:15 jgq516
  2011-09-29 12:15 ` [PATCH v2 2/2] net/fec: add poll controller function for fec nic jgq516
  2011-09-29 18:54 ` [PATCH v2 1/2] net/fec: replace hardcoded irq num with macro David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: jgq516 @ 2011-09-29 12:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, jgq516

From: Xiao Jiang <jgq516@gmail.com>

Don't use hardcoded irq num and replace it with
FEC_IRQ_NUM macro.

Signed-off-by: Xiao Jiang <jgq516@gmail.com>
---
The two patches are based on git://github.com/davem330/net-next.git
pls correct me if I still used wrong tree.

Thanks,
Xiao Jiang

 drivers/net/ethernet/freescale/fec.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index cce78ce..1794ea4 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -177,6 +177,8 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address");
 #define PKT_MINBUF_SIZE		64
 #define PKT_MAXBLR_SIZE		1520
 
+/* This device has up to three irqs on some platforms */
+#define FEC_IRQ_NUM		3
 
 /*
  * The 5270/5271/5280/5282/532x RX control register also contains maximum frame
@@ -1540,8 +1542,7 @@ fec_probe(struct platform_device *pdev)
 
 	fec_reset_phy(pdev);
 
-	/* This device has up to three irqs on some platforms */
-	for (i = 0; i < 3; i++) {
+	for (i = 0; i < FEC_IRQ_NUM; i++) {
 		irq = platform_get_irq(pdev, i);
 		if (i && irq < 0)
 			break;
@@ -1586,7 +1587,7 @@ failed_init:
 	clk_disable(fep->clk);
 	clk_put(fep->clk);
 failed_clk:
-	for (i = 0; i < 3; i++) {
+	for (i = 0; i < FEC_IRQ_NUM; i++) {
 		irq = platform_get_irq(pdev, i);
 		if (irq > 0)
 			free_irq(irq, ndev);
-- 
1.7.6.1

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

end of thread, other threads:[~2011-09-29 18:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-29 12:15 [PATCH v2 1/2] net/fec: replace hardcoded irq num with macro jgq516
2011-09-29 12:15 ` [PATCH v2 2/2] net/fec: add poll controller function for fec nic jgq516
2011-09-29 18:54   ` David Miller
2011-09-29 18:54 ` [PATCH v2 1/2] net/fec: replace hardcoded irq num with macro 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).