diff mbox

3c509.c: call SET_NETDEV_DEV for all device types (ISA/ISAPnP/EISA)

Message ID 1367272013-2496-1-git-send-email-tedheadster@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

tedheadster April 29, 2013, 9:46 p.m. UTC
The venerable 3c509 driver only sets its device parent in one case, the ISAPnP one.
It does this with the SET_NETDEV_DEV function. It should register with the device
hierarchy in two additional cases: standard (non-PnP) ISA and EISA.

- Currently they appear here:
/sys/devices/virtual/net/eth0 (standard ISA)
/sys/devices/virtual/net/eth1 (EISA)

- Rather, they should instead be here:
/sys/devices/isa/3c509.0/net/eth0 (standard ISA)
/sys/devices/pci0000:00/0000:00:07.0/00:04/net/eth1 (EISA)

Tested on ISA and EISA boards.

Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
---
 drivers/net/ethernet/3com/3c509.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

David Miller April 30, 2013, 7:33 p.m. UTC | #1
From: Matthew Whitehead <tedheadster@gmail.com>
Date: Mon, 29 Apr 2013 17:46:53 -0400

> The venerable 3c509 driver only sets its device parent in one case, the ISAPnP one.
> It does this with the SET_NETDEV_DEV function. It should register with the device
> hierarchy in two additional cases: standard (non-PnP) ISA and EISA.
> 
> - Currently they appear here:
> /sys/devices/virtual/net/eth0 (standard ISA)
> /sys/devices/virtual/net/eth1 (EISA)
> 
> - Rather, they should instead be here:
> /sys/devices/isa/3c509.0/net/eth0 (standard ISA)
> /sys/devices/pci0000:00/0000:00:07.0/00:04/net/eth1 (EISA)
> 
> Tested on ISA and EISA boards.
> 
> Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>

Applied and queued up for -stable, thanks for being so persistent
about this fix :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/3com/3c509.c b/drivers/net/ethernet/3com/3c509.c
index f36ff99..adb4bf5 100644
--- a/drivers/net/ethernet/3com/3c509.c
+++ b/drivers/net/ethernet/3com/3c509.c
@@ -306,6 +306,7 @@  static int el3_isa_match(struct device *pdev, unsigned int ndev)
 	if (!dev)
 		return -ENOMEM;
 
+	SET_NETDEV_DEV(dev, pdev);
 	netdev_boot_setup_check(dev);
 
 	if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509-isa")) {
@@ -595,6 +596,7 @@  static int __init el3_eisa_probe (struct device *device)
 		return -ENOMEM;
 	}
 
+	SET_NETDEV_DEV(dev, device);
 	netdev_boot_setup_check(dev);
 
 	el3_dev_fill(dev, phys_addr, ioaddr, irq, if_port, EL3_EISA);