Commit ade66a60 authored by David Gibson's avatar David Gibson Committed by Jeff Garzik

[PATCH] orinoco merge preliminaries - use netdev_priv()

Use the netdev_priv() macro instead of directly accessing dev->priv.
Signed-off-by: default avatarDavid Gibson <hermes@gibson.dropbear.id.au>

Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
parent d97bdc8d
...@@ -50,7 +50,7 @@ static int ...@@ -50,7 +50,7 @@ static int
airport_suspend(struct macio_dev *mdev, u32 state) airport_suspend(struct macio_dev *mdev, u32 state)
{ {
struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev); struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev);
struct orinoco_private *priv = dev->priv; struct orinoco_private *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
int err; int err;
...@@ -84,7 +84,7 @@ static int ...@@ -84,7 +84,7 @@ static int
airport_resume(struct macio_dev *mdev) airport_resume(struct macio_dev *mdev)
{ {
struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev); struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev);
struct orinoco_private *priv = dev->priv; struct orinoco_private *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
int err; int err;
...@@ -126,7 +126,7 @@ static int ...@@ -126,7 +126,7 @@ static int
airport_detach(struct macio_dev *mdev) airport_detach(struct macio_dev *mdev)
{ {
struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev); struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev);
struct orinoco_private *priv = dev->priv; struct orinoco_private *priv = netdev_priv(dev);
struct airport *card = priv->card; struct airport *card = priv->card;
if (card->ndev_registered) if (card->ndev_registered)
...@@ -204,7 +204,7 @@ airport_attach(struct macio_dev *mdev, const struct of_match *match) ...@@ -204,7 +204,7 @@ airport_attach(struct macio_dev *mdev, const struct of_match *match)
printk(KERN_ERR "airport: can't allocate device datas\n"); printk(KERN_ERR "airport: can't allocate device datas\n");
return -ENODEV; return -ENODEV;
} }
priv = dev->priv; priv = netdev_priv(dev);
card = priv->card; card = priv->card;
hw = &priv->hw; hw = &priv->hw;
......
...@@ -2341,7 +2341,7 @@ struct net_device *alloc_orinocodev(int sizeof_card, int (*hard_reset)(struct or ...@@ -2341,7 +2341,7 @@ struct net_device *alloc_orinocodev(int sizeof_card, int (*hard_reset)(struct or
priv = netdev_priv(dev); priv = netdev_priv(dev);
priv->ndev = dev; priv->ndev = dev;
if (sizeof_card) if (sizeof_card)
priv->card = (void *)((unsigned long)dev->priv + sizeof(struct orinoco_private)); priv->card = (void *)((unsigned long)netdev_priv(dev) + sizeof(struct orinoco_private));
else else
priv->card = NULL; priv->card = NULL;
......
...@@ -163,7 +163,7 @@ orinoco_cs_attach(void) ...@@ -163,7 +163,7 @@ orinoco_cs_attach(void)
dev = alloc_orinocodev(sizeof(*card), orinoco_cs_hard_reset); dev = alloc_orinocodev(sizeof(*card), orinoco_cs_hard_reset);
if (! dev) if (! dev)
return NULL; return NULL;
priv = dev->priv; priv = netdev_priv(dev);
card = priv->card; card = priv->card;
/* Link both structures together */ /* Link both structures together */
...@@ -266,7 +266,7 @@ orinoco_cs_config(dev_link_t *link) ...@@ -266,7 +266,7 @@ orinoco_cs_config(dev_link_t *link)
{ {
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
client_handle_t handle = link->handle; client_handle_t handle = link->handle;
struct orinoco_private *priv = dev->priv; struct orinoco_private *priv = netdev_priv(dev);
struct orinoco_pccard *card = priv->card; struct orinoco_pccard *card = priv->card;
hermes_t *hw = &priv->hw; hermes_t *hw = &priv->hw;
int last_fn, last_ret; int last_fn, last_ret;
...@@ -499,7 +499,7 @@ static void ...@@ -499,7 +499,7 @@ static void
orinoco_cs_release(dev_link_t *link) orinoco_cs_release(dev_link_t *link)
{ {
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
struct orinoco_private *priv = dev->priv; struct orinoco_private *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
/* We're committed to taking the device away now, so mark the /* We're committed to taking the device away now, so mark the
...@@ -527,7 +527,7 @@ orinoco_cs_event(event_t event, int priority, ...@@ -527,7 +527,7 @@ orinoco_cs_event(event_t event, int priority,
{ {
dev_link_t *link = args->client_data; dev_link_t *link = args->client_data;
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
struct orinoco_private *priv = dev->priv; struct orinoco_private *priv = netdev_priv(dev);
struct orinoco_pccard *card = priv->card; struct orinoco_pccard *card = priv->card;
int err = 0; int err = 0;
unsigned long flags; unsigned long flags;
......
...@@ -212,7 +212,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, ...@@ -212,7 +212,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
err = -ENOMEM; err = -ENOMEM;
goto fail; goto fail;
} }
priv = dev->priv; priv = netdev_priv(dev);
dev->base_addr = (unsigned long) pci_ioaddr; dev->base_addr = (unsigned long) pci_ioaddr;
dev->mem_start = pci_iorange; dev->mem_start = pci_iorange;
...@@ -275,7 +275,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, ...@@ -275,7 +275,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev) static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct orinoco_private *priv = dev->priv; struct orinoco_private *priv = netdev_priv(dev);
unregister_netdev(dev); unregister_netdev(dev);
...@@ -294,7 +294,7 @@ static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev) ...@@ -294,7 +294,7 @@ static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev)
static int orinoco_pci_suspend(struct pci_dev *pdev, u32 state) static int orinoco_pci_suspend(struct pci_dev *pdev, u32 state)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct orinoco_private *priv = dev->priv; struct orinoco_private *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
int err; int err;
...@@ -325,7 +325,7 @@ static int orinoco_pci_suspend(struct pci_dev *pdev, u32 state) ...@@ -325,7 +325,7 @@ static int orinoco_pci_suspend(struct pci_dev *pdev, u32 state)
static int orinoco_pci_resume(struct pci_dev *pdev) static int orinoco_pci_resume(struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct orinoco_private *priv = dev->priv; struct orinoco_private *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
int err; int err;
......
...@@ -229,7 +229,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, ...@@ -229,7 +229,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
goto fail; goto fail;
} }
priv = dev->priv; priv = netdev_priv(dev);
dev->base_addr = pccard_ioaddr; dev->base_addr = pccard_ioaddr;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
......
...@@ -121,7 +121,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, ...@@ -121,7 +121,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
goto fail; goto fail;
} }
priv = dev->priv; priv = netdev_priv(dev);
dev->base_addr = pccard_ioaddr; dev->base_addr = pccard_ioaddr;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
......
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