Commit 513f042e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Call SET_NETDEV_DEV() in a bunch of net drivers

Used for sysfs support.
parent ece91eb2
...@@ -426,6 +426,7 @@ static int __init el3_probe(int card_idx) ...@@ -426,6 +426,7 @@ static int __init el3_probe(int card_idx)
} }
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &idev->dev);
pnp_cards++; pnp_cards++;
netdev_boot_setup_check(dev); netdev_boot_setup_check(dev);
......
...@@ -538,6 +538,7 @@ static struct net_device *corkscrew_scan(int unit) ...@@ -538,6 +538,7 @@ static struct net_device *corkscrew_scan(int unit)
inl(ioaddr + 0x2002), inw(ioaddr + 0x2000)); inl(ioaddr + 0x2002), inw(ioaddr + 0x2000));
/* irq = inw(ioaddr + 0x2002) & 15; */ /* Use the irq from isapnp */ /* irq = inw(ioaddr + 0x2002) & 15; */ /* Use the irq from isapnp */
corkscrew_setup(dev, ioaddr, idev, cards_found++); corkscrew_setup(dev, ioaddr, idev, cards_found++);
SET_NETDEV_DEV(dev, &idev->dev);
pnp_cards++; pnp_cards++;
err = register_netdev(dev); err = register_netdev(dev);
if (!err) if (!err)
......
...@@ -2036,6 +2036,7 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev, ...@@ -2036,6 +2036,7 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
} }
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
#if AMD8111E_VLAN_TAG_USED #if AMD8111E_VLAN_TAG_USED
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX ; dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX ;
......
...@@ -1668,6 +1668,7 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid) ...@@ -1668,6 +1668,7 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
#endif #endif
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pci_dev->dev);
dev->hard_start_xmit = toshoboe_hard_xmit; dev->hard_start_xmit = toshoboe_hard_xmit;
dev->open = toshoboe_net_open; dev->open = toshoboe_net_open;
dev->stop = toshoboe_net_close; dev->stop = toshoboe_net_close;
......
...@@ -1622,6 +1622,8 @@ static int vlsi_irda_init(struct net_device *ndev) ...@@ -1622,6 +1622,8 @@ static int vlsi_irda_init(struct net_device *ndev)
ndev->tx_timeout = vlsi_tx_timeout; ndev->tx_timeout = vlsi_tx_timeout;
ndev->watchdog_timeo = 500*HZ/1000; /* max. allowed turn time for IrLAP */ ndev->watchdog_timeo = 500*HZ/1000; /* max. allowed turn time for IrLAP */
SET_NETDEV_DEV(ndev, &pdev->dev);
return 0; return 0;
} }
......
...@@ -1146,6 +1146,7 @@ static int __devinit saa9730_init_one(struct pci_dev *pdev, const struct pci_dev ...@@ -1146,6 +1146,7 @@ static int __devinit saa9730_init_one(struct pci_dev *pdev, const struct pci_dev
} }
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
SET_NETDEV_DEV(dev, &pdev->dev);
return 0; return 0;
out2: out2:
......
...@@ -382,6 +382,7 @@ static int __init skge_probe (void) ...@@ -382,6 +382,7 @@ static int __init skge_probe (void)
dev->do_ioctl = &SkGeIoctl; dev->do_ioctl = &SkGeIoctl;
dev->change_mtu = &SkGeChangeMtu; dev->change_mtu = &SkGeChangeMtu;
dev->flags &= ~IFF_RUNNING; dev->flags &= ~IFF_RUNNING;
SET_NETDEV_DEV(dev, &pdev->dev);
#ifdef SK_ZEROCOPY #ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM #ifdef USE_SK_TX_CHECKSUM
......
...@@ -597,6 +597,7 @@ static int __devinit tc35815_probe1(struct pci_dev *pdev, unsigned int base_addr ...@@ -597,6 +597,7 @@ static int __devinit tc35815_probe1(struct pci_dev *pdev, unsigned int base_addr
dev->get_stats = tc35815_get_stats; dev->get_stats = tc35815_get_stats;
dev->set_multicast_list = tc35815_set_multicast_list; dev->set_multicast_list = tc35815_set_multicast_list;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
ret = register_netdev(dev); ret = register_netdev(dev);
if (ret) if (ret)
......
...@@ -345,6 +345,7 @@ int __devinit xl_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -345,6 +345,7 @@ int __devinit xl_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->get_stats=&xl_get_stats ; dev->get_stats=&xl_get_stats ;
dev->set_mac_address=&xl_set_mac_address ; dev->set_mac_address=&xl_set_mac_address ;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
pci_set_drvdata(pdev,dev) ; pci_set_drvdata(pdev,dev) ;
if ((i = register_netdev(dev))) { if ((i = register_netdev(dev))) {
......
...@@ -167,6 +167,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_ ...@@ -167,6 +167,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_
dev->stop = abyss_close; dev->stop = abyss_close;
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
SET_NETDEV_DEV(dev, &pdev->dev);
ret = register_netdev(dev); ret = register_netdev(dev);
if (ret) if (ret)
......
...@@ -332,6 +332,7 @@ static int __devinit streamer_init_one(struct pci_dev *pdev, ...@@ -332,6 +332,7 @@ static int __devinit streamer_init_one(struct pci_dev *pdev,
dev->set_mac_address = &streamer_set_mac_address; dev->set_mac_address = &streamer_set_mac_address;
dev->irq = pdev->irq; dev->irq = pdev->irq;
dev->base_addr=pio_start; dev->base_addr=pio_start;
SET_NETDEV_DEV(dev, &pdev->dev);
streamer_priv->streamer_card_name = (char *)pdev->resource[0].name; streamer_priv->streamer_card_name = (char *)pdev->resource[0].name;
streamer_priv->pci_dev = pdev; streamer_priv->pci_dev = pdev;
......
...@@ -259,6 +259,7 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device ...@@ -259,6 +259,7 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device
dev->get_stats=&olympic_get_stats ; dev->get_stats=&olympic_get_stats ;
dev->set_mac_address=&olympic_set_mac_address ; dev->set_mac_address=&olympic_set_mac_address ;
SET_MODULE_OWNER(dev) ; SET_MODULE_OWNER(dev) ;
SET_NETDEV_DEV(dev, &pdev->dev);
pci_set_drvdata(pdev,dev) ; pci_set_drvdata(pdev,dev) ;
register_netdev(dev) ; register_netdev(dev) ;
......
...@@ -164,6 +164,7 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic ...@@ -164,6 +164,7 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic
dev->open = tms380tr_open; dev->open = tms380tr_open;
dev->stop = tms380tr_close; dev->stop = tms380tr_close;
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
SET_NETDEV_DEV(dev, &pdev->dev);
ret = register_netdev(dev); ret = register_netdev(dev);
if (ret) if (ret)
......
...@@ -333,8 +333,10 @@ sbni_pci_probe( struct net_device *dev ) ...@@ -333,8 +333,10 @@ sbni_pci_probe( struct net_device *dev )
release_region( pci_ioaddr, SBNI_IO_EXTENT ); release_region( pci_ioaddr, SBNI_IO_EXTENT );
return -EIO; return -EIO;
} }
if( sbni_probe1( dev, pci_ioaddr, pci_irq_line ) ) if( sbni_probe1( dev, pci_ioaddr, pci_irq_line ) ) {
SET_NETDEV_DEV(dev, &pdev->dev);
return 0; return 0;
}
} }
return -ENODEV; return -ENODEV;
} }
......
...@@ -2732,6 +2732,11 @@ struct net_device *_init_airo_card( unsigned short irq, int port, ...@@ -2732,6 +2732,11 @@ struct net_device *_init_airo_card( unsigned short irq, int port,
dev->irq = irq; dev->irq = irq;
dev->base_addr = port; dev->base_addr = port;
/* what is with PCMCIA ??? */
if (pci) {
SET_NETDEV_DEV(dev, &pci->dev);
}
if (test_bit(FLAG_MPI,&ai->flags)) if (test_bit(FLAG_MPI,&ai->flags))
reset_mpi_card (dev, 1); reset_mpi_card (dev, 1);
......
...@@ -220,6 +220,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, ...@@ -220,6 +220,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
dev->mem_end = pci_iorange + pci_iolen - 1; dev->mem_end = pci_iorange + pci_iolen - 1;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
printk(KERN_DEBUG printk(KERN_DEBUG
"Detected Orinoco/Prism2 PCI device at %s, mem:0x%lX to 0x%lX -> 0x%p, irq:%d\n", "Detected Orinoco/Prism2 PCI device at %s, mem:0x%lX to 0x%lX -> 0x%p, irq:%d\n",
......
...@@ -233,6 +233,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, ...@@ -233,6 +233,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
priv = dev->priv; priv = dev->priv;
dev->base_addr = pccard_ioaddr; dev->base_addr = pccard_ioaddr;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
printk(KERN_DEBUG printk(KERN_DEBUG
"Detected Orinoco/Prism2 PLX device at %s irq:%d, io addr:0x%lx\n", "Detected Orinoco/Prism2 PLX device at %s irq:%d, io addr:0x%lx\n",
......
...@@ -125,6 +125,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, ...@@ -125,6 +125,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
priv = dev->priv; priv = dev->priv;
dev->base_addr = pccard_ioaddr; dev->base_addr = pccard_ioaddr;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
printk(KERN_DEBUG printk(KERN_DEBUG
"Detected Orinoco/Prism2 TMD device at %s irq:%d, io addr:0x%lx\n", "Detected Orinoco/Prism2 TMD device at %s irq:%d, io addr:0x%lx\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment