st_smi: Read status until timeout happens
authorVipin KUMAR <vipin.kumar@st.com>
Mon, 7 May 2012 07:30:23 +0000 (13:00 +0530)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 7 Jul 2012 12:07:38 +0000 (14:07 +0200)
SMI driver read status fails because the control register could not be
overwritten. Instead, the read status should be tried until timeout.

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
drivers/mtd/st_smi.c

index 2c6d59ddbbf20c96014a430ed053e4c7f313e2f3..088c7c7b7c5c0f52c40fac863852b05e3eb02522 100644 (file)
@@ -187,7 +187,7 @@ static int smi_wait_till_ready(int bank, int timeout)
        do {
                sr = smi_read_sr(bank);
                if (sr < 0)
-                       break;
+                       continue;       /* try until timeout */
                else if (!(sr & WIP_BIT))
                        return 0;