rt2x00 : bail out of regbusy_read if device is removed.
authorAlban Browaeys <prahal@yahoo.com>
Fri, 4 Dec 2009 22:46:57 +0000 (23:46 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 21 Dec 2009 23:56:23 +0000 (18:56 -0500)
platform rfkill is async thus we may try to read while the device is
already off.

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <ivdoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00pci.c

index 0feb4d0e4668910905cdd44f72eb3232e349c4f0..801be436cf1d1bf8f01f16bfd33c84a1ca72641e 100644 (file)
@@ -41,6 +41,9 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev,
 {
        unsigned int i;
 
+       if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
+               return 0;
+
        for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
                rt2x00pci_register_read(rt2x00dev, offset, reg);
                if (!rt2x00_get_field32(*reg, field))