aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-05-17 08:00:01 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-19 13:54:07 -0400
commit0355a3452fe218b2bc61a7a571064ee86dd6bf4e (patch)
tree1075e2f1e54b81db3d200eb1bbd4dfcbfcec362f /drivers/net/wireless/b43
parent620d785ba9066d5436857ec8e7c104c7b1c467e1 (diff)
b43: make b43_wireless_init less bus specific
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r--drivers/net/wireless/b43/main.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index ea58e27ef215..fcbf67063c3a 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4925,19 +4925,16 @@ static void b43_wireless_exit(struct ssb_device *dev, struct b43_wl *wl)
4925 ieee80211_free_hw(hw); 4925 ieee80211_free_hw(hw);
4926} 4926}
4927 4927
4928static int b43_wireless_init(struct ssb_device *dev) 4928static struct b43_wl *b43_wireless_init(struct ssb_device *dev)
4929{ 4929{
4930 struct ssb_sprom *sprom = &dev->bus->sprom; 4930 struct ssb_sprom *sprom = &dev->bus->sprom;
4931 struct ieee80211_hw *hw; 4931 struct ieee80211_hw *hw;
4932 struct b43_wl *wl; 4932 struct b43_wl *wl;
4933 int err = -ENOMEM;
4934
4935 b43_sprom_fixup(dev->bus);
4936 4933
4937 hw = ieee80211_alloc_hw(sizeof(*wl), &b43_hw_ops); 4934 hw = ieee80211_alloc_hw(sizeof(*wl), &b43_hw_ops);
4938 if (!hw) { 4935 if (!hw) {
4939 b43err(NULL, "Could not allocate ieee80211 device\n"); 4936 b43err(NULL, "Could not allocate ieee80211 device\n");
4940 goto out; 4937 return ERR_PTR(-ENOMEM);
4941 } 4938 }
4942 wl = hw_to_b43_wl(hw); 4939 wl = hw_to_b43_wl(hw);
4943 4940
@@ -4971,12 +4968,9 @@ static int b43_wireless_init(struct ssb_device *dev)
4971 INIT_WORK(&wl->tx_work, b43_tx_work); 4968 INIT_WORK(&wl->tx_work, b43_tx_work);
4972 skb_queue_head_init(&wl->tx_queue); 4969 skb_queue_head_init(&wl->tx_queue);
4973 4970
4974 ssb_set_devtypedata(dev, wl);
4975 b43info(wl, "Broadcom %04X WLAN found (core revision %u)\n", 4971 b43info(wl, "Broadcom %04X WLAN found (core revision %u)\n",
4976 dev->bus->chip_id, dev->id.revision); 4972 dev->bus->chip_id, dev->id.revision);
4977 err = 0; 4973 return wl;
4978out:
4979 return err;
4980} 4974}
4981 4975
4982static int b43_ssb_probe(struct ssb_device *dev, const struct ssb_device_id *id) 4976static int b43_ssb_probe(struct ssb_device *dev, const struct ssb_device_id *id)
@@ -4989,11 +4983,14 @@ static int b43_ssb_probe(struct ssb_device *dev, const struct ssb_device_id *id)
4989 if (!wl) { 4983 if (!wl) {
4990 /* Probing the first core. Must setup common struct b43_wl */ 4984 /* Probing the first core. Must setup common struct b43_wl */
4991 first = 1; 4985 first = 1;
4992 err = b43_wireless_init(dev); 4986 b43_sprom_fixup(dev->bus);
4993 if (err) 4987 wl = b43_wireless_init(dev);
4988 if (IS_ERR(wl)) {
4989 err = PTR_ERR(wl);
4994 goto out; 4990 goto out;
4995 wl = ssb_get_devtypedata(dev); 4991 }
4996 B43_WARN_ON(!wl); 4992 ssb_set_devtypedata(dev, wl);
4993 B43_WARN_ON(ssb_get_devtypedata(dev) != wl);
4997 } 4994 }
4998 err = b43_one_core_attach(dev, wl); 4995 err = b43_one_core_attach(dev, wl);
4999 if (err) 4996 if (err)