Skip to content

Commit

Permalink
rt2x00 : bail out of regbusy_read if device is removed.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alban Browaeys authored and John W. Linville committed Dec 21, 2009
1 parent 050e8a4 commit c70762f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/rt2x00/rt2x00pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c70762f

Please sign in to comment.