libertas: fix 8686 firmware loading regression
authorDan Williams <dcbw@redhat.com>
Wed, 28 Apr 2010 19:37:46 +0000 (12:37 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 28 Apr 2010 20:49:23 +0000 (16:49 -0400)
The 'ready' condition was incorrectly evaluated which sometimes lead to
failures loading the second-stage firmware on 8686 devices.

(This was introduced in "libertas: consolidate SDIO firmware wait code".
-- JWL)

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/if_sdio.c

index 68cc407054e3f2e4284a22c5be2257c53d6f9122..094176e92ebe6f5ecda038e9e6f22ef1824c787a 100644 (file)
@@ -323,7 +323,9 @@ static int if_sdio_wait_status(struct if_sdio_card *card, const u8 condition)
        timeout = jiffies + HZ;
        while (1) {
                status = sdio_readb(card->func, IF_SDIO_STATUS, &ret);
-               if (ret || (status & condition))
+               if (ret)
+                       return ret;
+               if ((status & condition) == condition)
                        break;
                if (time_after(jiffies, timeout))
                        return -ETIMEDOUT;