orinoco: Replace net_device with orinoco_private in driver interfaces
Move away from using net_device as the main structure in orinoco function calls. Use orinoco_private instead. This makes more sense when we move to cfg80211, and we get wiphys as well. Signed-off-by: David Kilroy <kilroyd@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
44d8dade8f
commit
a2608362b2
10 changed files with 132 additions and 139 deletions
|
@ -124,15 +124,15 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
|
|||
}
|
||||
|
||||
/* Allocate network device */
|
||||
dev = alloc_orinocodev(sizeof(*card), &pdev->dev,
|
||||
orinoco_tmd_cor_reset, NULL);
|
||||
if (!dev) {
|
||||
priv = alloc_orinocodev(sizeof(*card), &pdev->dev,
|
||||
orinoco_tmd_cor_reset, NULL);
|
||||
if (!priv) {
|
||||
printk(KERN_ERR PFX "Cannot allocate network device\n");
|
||||
err = -ENOMEM;
|
||||
goto fail_alloc;
|
||||
}
|
||||
|
||||
priv = netdev_priv(dev);
|
||||
dev = priv->ndev;
|
||||
card = priv->card;
|
||||
card->bridge_io = bridge_io;
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
|
@ -140,7 +140,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
|
|||
hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING);
|
||||
|
||||
err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
|
||||
dev->name, dev);
|
||||
dev->name, priv);
|
||||
if (err) {
|
||||
printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
|
||||
err = -EBUSY;
|
||||
|
@ -159,18 +159,18 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
pci_set_drvdata(pdev, dev);
|
||||
pci_set_drvdata(pdev, priv);
|
||||
printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
|
||||
pci_name(pdev));
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
free_irq(pdev->irq, dev);
|
||||
free_irq(pdev->irq, priv);
|
||||
|
||||
fail_irq:
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
free_orinocodev(dev);
|
||||
free_orinocodev(priv);
|
||||
|
||||
fail_alloc:
|
||||
pci_iounmap(pdev, hermes_io);
|
||||
|
@ -189,14 +189,14 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
|
|||
|
||||
static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev)
|
||||
{
|
||||
struct net_device *dev = pci_get_drvdata(pdev);
|
||||
struct orinoco_private *priv = netdev_priv(dev);
|
||||
struct orinoco_private *priv = pci_get_drvdata(pdev);
|
||||
struct net_device *dev = priv->ndev;
|
||||
struct orinoco_pci_card *card = priv->card;
|
||||
|
||||
unregister_netdev(dev);
|
||||
free_irq(pdev->irq, dev);
|
||||
free_irq(pdev->irq, priv);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
free_orinocodev(dev);
|
||||
free_orinocodev(priv);
|
||||
pci_iounmap(pdev, priv->hw.iobase);
|
||||
pci_iounmap(pdev, card->bridge_io);
|
||||
pci_release_regions(pdev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue