Little bugfix that we never exit the mmc init wait loop before the timeout
expires.

Signed-off-by: Andy Green <[EMAIL PROTECTED]>
---

 src/drivers/glamo-mmc.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/drivers/glamo-mmc.c b/src/drivers/glamo-mmc.c
index a031d0b..4df2ec6 100644
--- a/src/drivers/glamo-mmc.c
+++ b/src/drivers/glamo-mmc.c
@@ -673,16 +673,18 @@ int mmc_init(int verbose)
                if (resp)
                        continue;
 
-               if (response[3] & (1 << 6)) /* asserts block addressing */
+               if (response[3] & (1 << 6)) { /* asserts block addressing */
+                       retries = -2;
                        card_type = CARDTYPE_SDHC;
-
+               }
                if (response[3] & (1 << 7)) { /* not busy */
                        if (card_type == CARDTYPE_NONE)
                                card_type = CARDTYPE_SD;
+                       retries = -2;
                        break;
                }
        }
-       if (retries < 0) {
+       if (retries == -1) {
                puts("no response\n");
                return 1;
        }


Reply via email to