[PATCH 1/2] atmel/macb: fix device name when SOFT/HARD_IRQ enabled

Subsystems: networking drivers, the rest

STALE5656d

5 messages, 2 authors, 2011-02-12 · open the first message on its own page

[PATCH 1/2] atmel/macb: fix device name when SOFT/HARD_IRQ enabled

From: Jean-Christophe PLAGNIOL-VILLARD <hidden>
Date: 2011-02-09 12:43:36

From: Paul Chavent <redacted>

When listing processes on a system with SOFT/HARD_IRQ enabled,
the name of the ethernet device is [irq/eth%d] (instead of [irq/eth0] for example).

This patch call the request_irq function after having initialized the name of the device.

Signed-off-by: Paul Chavent <redacted>
Signed-off-by: Nicolas Ferre <redacted>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <redacted>
---
 drivers/net/macb.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index f69e73e..d642e08 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1170,16 +1170,6 @@ static int __init macb_probe(struct platform_device *pdev)
 		goto err_out_disable_clocks;
 	}
 
-	dev->irq = platform_get_irq(pdev, 0);
-	err = request_irq(dev->irq, macb_interrupt, IRQF_SAMPLE_RANDOM,
-			  dev->name, dev);
-	if (err) {
-		printk(KERN_ERR
-		       "%s: Unable to request IRQ %d (error %d)\n",
-		       dev->name, dev->irq, err);
-		goto err_out_iounmap;
-	}
-
 	dev->netdev_ops = &macb_netdev_ops;
 	netif_napi_add(dev, &bp->napi, macb_poll, 64);
 	dev->ethtool_ops = &macb_ethtool_ops;
@@ -1219,13 +1209,23 @@ static int __init macb_probe(struct platform_device *pdev)
 	err = register_netdev(dev);
 	if (err) {
 		dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
-		goto err_out_free_irq;
+		goto err_out_iounmap;
 	}
 
-	if (macb_mii_init(bp) != 0) {
+	dev->irq = platform_get_irq(pdev, 0);
+	err = request_irq(dev->irq, macb_interrupt, IRQF_SAMPLE_RANDOM,
+			  dev->name, dev);
+	if (err) {
+		printk(KERN_ERR
+		       "%s: Unable to request IRQ %d (error %d)\n",
+		       dev->name, dev->irq, err);
 		goto err_out_unregister_netdev;
 	}
 
+	if (macb_mii_init(bp) != 0) {
+		goto err_out_free_irq;
+	}
+
 	platform_set_drvdata(pdev, dev);
 
 	printk(KERN_INFO "%s: Atmel MACB at 0x%08lx irq %d (%pM)\n",
@@ -1238,10 +1238,10 @@ static int __init macb_probe(struct platform_device *pdev)
 
 	return 0;
 
-err_out_unregister_netdev:
-	unregister_netdev(dev);
 err_out_free_irq:
 	free_irq(dev->irq, dev);
+err_out_unregister_netdev:
+	unregister_netdev(dev);
 err_out_iounmap:
 	iounmap(bp->regs);
 err_out_disable_clocks:
-- 
1.7.2.3

[PATCH 1/2] atmel/macb: fix device name when SOFT/HARD_IRQ enabled

From: Sergei Shtylyov <hidden>
Date: 2011-02-09 13:41:38

Hello.

On 09-02-2011 15:43, Jean-Christophe PLAGNIOL-VILLARD wrote:
From: Paul Chavent<redacted>
When listing processes on a system with SOFT/HARD_IRQ enabled,
the name of the ethernet device is [irq/eth%d] (instead of [irq/eth0] for example).
This patch call the request_irq function after having initialized the name of the device.
Signed-off-by: Paul Chavent<redacted>
Signed-off-by: Nicolas Ferre<redacted>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD<redacted>
[...]
quoted hunk
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index f69e73e..d642e08 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
[...]
quoted hunk
@@ -1219,13 +1209,23 @@ static int __init macb_probe(struct platform_device *pdev)
  	err = register_netdev(dev);
  	if (err) {
  		dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
-		goto err_out_free_irq;
+		goto err_out_iounmap;
  	}

-	if (macb_mii_init(bp) != 0) {
+	dev->irq = platform_get_irq(pdev, 0);
    platform_get_irq() can fail...
+	err = request_irq(dev->irq, macb_interrupt, IRQF_SAMPLE_RANDOM,
+			  dev->name, dev);
+	if (err) {
+		printk(KERN_ERR
+		       "%s: Unable to request IRQ %d (error %d)\n",
+		       dev->name, dev->irq, err);
  		goto err_out_unregister_netdev;
  	}

+	if (macb_mii_init(bp) != 0) {
+		goto err_out_free_irq;
+	}
    {} not needed here. I think checkpatch.pl should notice this.

WBR, Sergei

[PATCH 1/2] atmel/macb: fix device name when SOFT/HARD_IRQ enabled

From: Jean-Christophe PLAGNIOL-VILLARD <hidden>
Date: 2011-02-09 14:44:11

On 16:41 Wed 09 Feb     , Sergei Shtylyov wrote:
Hello.

On 09-02-2011 15:43, Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
From: Paul Chavent<redacted>
quoted
When listing processes on a system with SOFT/HARD_IRQ enabled,
the name of the ethernet device is [irq/eth%d] (instead of [irq/eth0] for example).
quoted
This patch call the request_irq function after having initialized the name of the device.
quoted
Signed-off-by: Paul Chavent<redacted>
Signed-off-by: Nicolas Ferre<redacted>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD<redacted>
[...]
quoted
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index f69e73e..d642e08 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
[...]
quoted
@@ -1219,13 +1209,23 @@ static int __init macb_probe(struct platform_device *pdev)
 	err = register_netdev(dev);
 	if (err) {
 		dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
-		goto err_out_free_irq;
+		goto err_out_iounmap;
 	}

-	if (macb_mii_init(bp) != 0) {
+	dev->irq = platform_get_irq(pdev, 0);
   platform_get_irq() can fail...
request_irq will fail too so do we really need to check it?
quoted
+	err = request_irq(dev->irq, macb_interrupt, IRQF_SAMPLE_RANDOM,
+			  dev->name, dev);
Best Regards,
J.

[PATCH 1/2] atmel/macb: fix device name when SOFT/HARD_IRQ enabled

From: Sergei Shtylyov <hidden>
Date: 2011-02-10 13:58:18

Hello.

On 09-02-2011 17:44, Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
quoted
From: Paul Chavent<redacted>
quoted
quoted
When listing processes on a system with SOFT/HARD_IRQ enabled,
the name of the ethernet device is [irq/eth%d] (instead of [irq/eth0] for example).
quoted
quoted
This patch call the request_irq function after having initialized the name of the device.
quoted
quoted
Signed-off-by: Paul Chavent<redacted>
Signed-off-by: Nicolas Ferre<redacted>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD<redacted>
[...]
quoted
quoted
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index f69e73e..d642e08 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
[...]
quoted
@@ -1219,13 +1209,23 @@ static int __init macb_probe(struct platform_device *pdev)
  	err = register_netdev(dev);
  	if (err) {
  		dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
-		goto err_out_free_irq;
+		goto err_out_iounmap;
  	}

-	if (macb_mii_init(bp) != 0) {
+	dev->irq = platform_get_irq(pdev, 0);
quoted
    platform_get_irq() can fail...
request_irq will fail too so do we really need to check it?
    You then will get the following printed:

macb: Unable to request IRQ -6 (error -22)

    If this is acceptable, then platfrom_get_irq()'s result can be ignored indeed.
quoted
quoted
+	err = request_irq(dev->irq, macb_interrupt, IRQF_SAMPLE_RANDOM,
+			  dev->name, dev);
Best Regards,
J.
WBR, Sergei

[PATCH 1/2] atmel/macb: fix device name when SOFT/HARD_IRQ enabled

From: Jean-Christophe PLAGNIOL-VILLARD <hidden>
Date: 2011-02-12 14:30:00

On 16:58 Thu 10 Feb     , Sergei Shtylyov wrote:
Hello.

On 09-02-2011 17:44, Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
quoted
quoted
From: Paul Chavent<redacted>
quoted
quoted
quoted
When listing processes on a system with SOFT/HARD_IRQ enabled,
the name of the ethernet device is [irq/eth%d] (instead of [irq/eth0] for example).
quoted
quoted
quoted
This patch call the request_irq function after having initialized the name of the device.
quoted
quoted
quoted
Signed-off-by: Paul Chavent<redacted>
Signed-off-by: Nicolas Ferre<redacted>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD<redacted>
[...]
quoted
quoted
quoted
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index f69e73e..d642e08 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
[...]
quoted
@@ -1219,13 +1209,23 @@ static int __init macb_probe(struct platform_device *pdev)
 	err = register_netdev(dev);
 	if (err) {
 		dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
-		goto err_out_free_irq;
+		goto err_out_iounmap;
 	}

-	if (macb_mii_init(bp) != 0) {
+	dev->irq = platform_get_irq(pdev, 0);
quoted
quoted
   platform_get_irq() can fail...
quoted
request_irq will fail too so do we really need to check it?
   You then will get the following printed:

macb: Unable to request IRQ -6 (error -22)

   If this is acceptable, then platfrom_get_irq()'s result can be ignored indeed.
yes it's

Best Regards,
J.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help