Patchwork [63/78] 3c509.c: call SET_NETDEV_DEV for all device types (ISA/ISAPnP/EISA)

mail settings
Submitter Kamal Mostafa
Date May 28, 2013, 9:20 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/247024/
State New
Headers show


Kamal Mostafa - May 28, 2013, 9:20 p.m. -stable review patch.  If anyone has any objections, please let me know.


From: Matthew Whitehead <>

[ Upstream commit 3b54912f9cd167641b91d4a697bd742f70e534fe ]

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 <>
Signed-off-by: David S. Miller <>
Signed-off-by: Kamal Mostafa <>
 drivers/net/ethernet/3com/3c509.c | 2 ++
 1 file changed, 2 insertions(+)


diff --git a/drivers/net/ethernet/3com/3c509.c b/drivers/net/ethernet/3com/3c509.c
index 633c709..d446bb4 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);
 	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);
 	el3_dev_fill(dev, phys_addr, ioaddr, irq, if_port, EL3_EISA);