diff options
author | David Kilroy <kilroyd@googlemail.com> | 2009-06-18 18:21:28 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:01:45 -0400 |
commit | 5381956b780e82805247c2ec8e32c4c665309394 (patch) | |
tree | 04f0f203a5b89dfd48fb8821be2c4ebf9ce3ed9a /drivers/net/wireless/orinoco/orinoco_pci.c | |
parent | 35832c50d1d1552618f55aa5457a251df9e63b26 (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_pci.c')
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco_pci.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/wireless/orinoco/orinoco_pci.c b/drivers/net/wireless/orinoco/orinoco_pci.c index d0eb4ae9bd1..fea7781948e 100644 --- a/drivers/net/wireless/orinoco/orinoco_pci.c +++ b/drivers/net/wireless/orinoco/orinoco_pci.c | |||
@@ -116,7 +116,6 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
116 | int err; | 116 | int err; |
117 | struct orinoco_private *priv; | 117 | struct orinoco_private *priv; |
118 | struct orinoco_pci_card *card; | 118 | struct orinoco_pci_card *card; |
119 | struct net_device *dev; | ||
120 | void __iomem *hermes_io; | 119 | void __iomem *hermes_io; |
121 | 120 | ||
122 | err = pci_enable_device(pdev); | 121 | err = pci_enable_device(pdev); |
@@ -147,14 +146,12 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
147 | goto fail_alloc; | 146 | goto fail_alloc; |
148 | } | 147 | } |
149 | 148 | ||
150 | dev = priv->ndev; | ||
151 | card = priv->card; | 149 | card = priv->card; |
152 | SET_NETDEV_DEV(dev, &pdev->dev); | ||
153 | 150 | ||
154 | hermes_struct_init(&priv->hw, hermes_io, HERMES_32BIT_REGSPACING); | 151 | hermes_struct_init(&priv->hw, hermes_io, HERMES_32BIT_REGSPACING); |
155 | 152 | ||
156 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, | 153 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, |
157 | dev->name, priv); | 154 | DRIVER_NAME, priv); |
158 | if (err) { | 155 | if (err) { |
159 | printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); | 156 | printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); |
160 | err = -EBUSY; | 157 | err = -EBUSY; |
@@ -173,15 +170,13 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
173 | goto fail; | 170 | goto fail; |
174 | } | 171 | } |
175 | 172 | ||
176 | err = register_netdev(dev); | 173 | err = orinoco_if_add(priv, 0, 0); |
177 | if (err) { | 174 | if (err) { |
178 | printk(KERN_ERR PFX "Cannot register network device\n"); | 175 | printk(KERN_ERR PFX "orinoco_if_add() failed\n"); |
179 | goto fail; | 176 | goto fail; |
180 | } | 177 | } |
181 | 178 | ||
182 | pci_set_drvdata(pdev, priv); | 179 | pci_set_drvdata(pdev, priv); |
183 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, | ||
184 | pci_name(pdev)); | ||
185 | 180 | ||
186 | return 0; | 181 | return 0; |
187 | 182 | ||
@@ -207,9 +202,8 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
207 | static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev) | 202 | static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev) |
208 | { | 203 | { |
209 | struct orinoco_private *priv = pci_get_drvdata(pdev); | 204 | struct orinoco_private *priv = pci_get_drvdata(pdev); |
210 | struct net_device *dev = priv->ndev; | ||
211 | 205 | ||
212 | unregister_netdev(dev); | 206 | orinoco_if_del(priv); |
213 | free_irq(pdev->irq, priv); | 207 | free_irq(pdev->irq, priv); |
214 | pci_set_drvdata(pdev, NULL); | 208 | pci_set_drvdata(pdev, NULL); |
215 | free_orinocodev(priv); | 209 | free_orinocodev(priv); |