aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco/orinoco_plx.c
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2009-06-18 18:21:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:01:45 -0400
commit5381956b780e82805247c2ec8e32c4c665309394 (patch)
tree04f0f203a5b89dfd48fb8821be2c4ebf9ce3ed9a /drivers/net/wireless/orinoco/orinoco_plx.c
parent35832c50d1d1552618f55aa5457a251df9e63b26 (diff)
orinoco: move netdev interface creation to main driver
With the move to cfg80211 it's nice to keep the hardware operations distinct from the interface, even though we can only support a single interface. This also means the driver resembles other cfg80211 drivers. Signed-off-by: David Kilroy <kilroyd@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco/orinoco_plx.c')
-rw-r--r--drivers/net/wireless/orinoco/orinoco_plx.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/wireless/orinoco/orinoco_plx.c b/drivers/net/wireless/orinoco/orinoco_plx.c
index 8f225d064a7b..3f2942a1e4f5 100644
--- a/drivers/net/wireless/orinoco/orinoco_plx.c
+++ b/drivers/net/wireless/orinoco/orinoco_plx.c
@@ -183,7 +183,6 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
183 int err; 183 int err;
184 struct orinoco_private *priv; 184 struct orinoco_private *priv;
185 struct orinoco_pci_card *card; 185 struct orinoco_pci_card *card;
186 struct net_device *dev;
187 void __iomem *hermes_io, *attr_io, *bridge_io; 186 void __iomem *hermes_io, *attr_io, *bridge_io;
188 187
189 err = pci_enable_device(pdev); 188 err = pci_enable_device(pdev);
@@ -228,16 +227,14 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
228 goto fail_alloc; 227 goto fail_alloc;
229 } 228 }
230 229
231 dev = priv->ndev;
232 card = priv->card; 230 card = priv->card;
233 card->bridge_io = bridge_io; 231 card->bridge_io = bridge_io;
234 card->attr_io = attr_io; 232 card->attr_io = attr_io;
235 SET_NETDEV_DEV(dev, &pdev->dev);
236 233
237 hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING); 234 hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING);
238 235
239 err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, 236 err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
240 dev->name, priv); 237 DRIVER_NAME, priv);
241 if (err) { 238 if (err) {
242 printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); 239 printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
243 err = -EBUSY; 240 err = -EBUSY;
@@ -262,15 +259,13 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
262 goto fail; 259 goto fail;
263 } 260 }
264 261
265 err = register_netdev(dev); 262 err = orinoco_if_add(priv, 0, 0);
266 if (err) { 263 if (err) {
267 printk(KERN_ERR PFX "Cannot register network device\n"); 264 printk(KERN_ERR PFX "orinoco_if_add() failed\n");
268 goto fail; 265 goto fail;
269 } 266 }
270 267
271 pci_set_drvdata(pdev, priv); 268 pci_set_drvdata(pdev, priv);
272 printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
273 pci_name(pdev));
274 269
275 return 0; 270 return 0;
276 271
@@ -302,10 +297,9 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
302static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev) 297static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev)
303{ 298{
304 struct orinoco_private *priv = pci_get_drvdata(pdev); 299 struct orinoco_private *priv = pci_get_drvdata(pdev);
305 struct net_device *dev = priv->ndev;
306 struct orinoco_pci_card *card = priv->card; 300 struct orinoco_pci_card *card = priv->card;
307 301
308 unregister_netdev(dev); 302 orinoco_if_del(priv);
309 free_irq(pdev->irq, priv); 303 free_irq(pdev->irq, priv);
310 pci_set_drvdata(pdev, NULL); 304 pci_set_drvdata(pdev, NULL);
311 free_orinocodev(priv); 305 free_orinocodev(priv);