diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00pci.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index cdd5154bd4c0..cf3f1c0c4382 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | Copyright (C) 2004 - 2009 rt2x00 SourceForge Project | 2 | Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com> |
3 | <http://rt2x00.serialmonkey.com> | 3 | <http://rt2x00.serialmonkey.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/pci.h> | 29 | #include <linux/pci.h> |
30 | #include <linux/slab.h> | ||
30 | 31 | ||
31 | #include "rt2x00.h" | 32 | #include "rt2x00.h" |
32 | #include "rt2x00pci.h" | 33 | #include "rt2x00pci.h" |
@@ -41,6 +42,9 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev, | |||
41 | { | 42 | { |
42 | unsigned int i; | 43 | unsigned int i; |
43 | 44 | ||
45 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | ||
46 | return 0; | ||
47 | |||
44 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { | 48 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { |
45 | rt2x00pci_register_read(rt2x00dev, offset, reg); | 49 | rt2x00pci_register_read(rt2x00dev, offset, reg); |
46 | if (!rt2x00_get_field32(*reg, field)) | 50 | if (!rt2x00_get_field32(*reg, field)) |
@@ -269,7 +273,6 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) | |||
269 | struct ieee80211_hw *hw; | 273 | struct ieee80211_hw *hw; |
270 | struct rt2x00_dev *rt2x00dev; | 274 | struct rt2x00_dev *rt2x00dev; |
271 | int retval; | 275 | int retval; |
272 | u16 chip; | ||
273 | 276 | ||
274 | retval = pci_request_regions(pci_dev, pci_name(pci_dev)); | 277 | retval = pci_request_regions(pci_dev, pci_name(pci_dev)); |
275 | if (retval) { | 278 | if (retval) { |
@@ -310,11 +313,7 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) | |||
310 | rt2x00dev->irq = pci_dev->irq; | 313 | rt2x00dev->irq = pci_dev->irq; |
311 | rt2x00dev->name = pci_name(pci_dev); | 314 | rt2x00dev->name = pci_name(pci_dev); |
312 | 315 | ||
313 | /* | 316 | rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_PCI); |
314 | * Determine RT chipset by reading PCI header. | ||
315 | */ | ||
316 | pci_read_config_word(pci_dev, PCI_DEVICE_ID, &chip); | ||
317 | rt2x00_set_chip_rt(rt2x00dev, chip); | ||
318 | 317 | ||
319 | retval = rt2x00pci_alloc_reg(rt2x00dev); | 318 | retval = rt2x00pci_alloc_reg(rt2x00dev); |
320 | if (retval) | 319 | if (retval) |