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>
diff --git a/drivers/net/wireless/orinoco/orinoco_pci.c b/drivers/net/wireless/orinoco/orinoco_pci.c
index d0eb4ae..fea7781 100644
--- a/drivers/net/wireless/orinoco/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco/orinoco_pci.c
@@ -116,7 +116,6 @@
 	int err;
 	struct orinoco_private *priv;
 	struct orinoco_pci_card *card;
-	struct net_device *dev;
 	void __iomem *hermes_io;
 
 	err = pci_enable_device(pdev);
@@ -147,14 +146,12 @@
 		goto fail_alloc;
 	}
 
-	dev = priv->ndev;
 	card = priv->card;
-	SET_NETDEV_DEV(dev, &pdev->dev);
 
 	hermes_struct_init(&priv->hw, hermes_io, HERMES_32BIT_REGSPACING);
 
 	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
-			  dev->name, priv);
+			  DRIVER_NAME, priv);
 	if (err) {
 		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
@@ -173,15 +170,13 @@
 		goto fail;
 	}
 
-	err = register_netdev(dev);
+	err = orinoco_if_add(priv, 0, 0);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot register network device\n");
+		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
 		goto fail;
 	}
 
 	pci_set_drvdata(pdev, priv);
-	printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
-	       pci_name(pdev));
 
 	return 0;
 
@@ -207,9 +202,8 @@
 static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev)
 {
 	struct orinoco_private *priv = pci_get_drvdata(pdev);
-	struct net_device *dev = priv->ndev;
 
-	unregister_netdev(dev);
+	orinoco_if_del(priv);
 	free_irq(pdev->irq, priv);
 	pci_set_drvdata(pdev, NULL);
 	free_orinocodev(priv);