USB: s3c-hsotg: Fix core reset
authorAnton Tikhomirov <av.tikhomirov@samsung.com>
Thu, 21 Apr 2011 08:06:38 +0000 (17:06 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 3 May 2011 00:00:25 +0000 (17:00 -0700)
This patch fixes code responsible for core reset.

Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com>
Reviewed-by: Kyoungil Kim<ki0351.kim@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/s3c-hsotg.c

index 0912679de99af870b91da2fefd6631c0a26d98ab..7cd597ca162f1b5818ab0c6b78299a61914b1549 100644 (file)
@@ -2491,9 +2491,9 @@ static int s3c_hsotg_corereset(struct s3c_hsotg *hsotg)
        timeout = 1000;
        do {
                grstctl = readl(hsotg->regs + S3C_GRSTCTL);
-       } while (!(grstctl & S3C_GRSTCTL_CSftRst) && timeout-- > 0);
+       } while ((grstctl & S3C_GRSTCTL_CSftRst) && timeout-- > 0);
 
-       if (!(grstctl & S3C_GRSTCTL_CSftRst)) {
+       if (grstctl & S3C_GRSTCTL_CSftRst) {
                dev_err(hsotg->dev, "Failed to get CSftRst asserted\n");
                return -EINVAL;
        }
@@ -2510,9 +2510,6 @@ static int s3c_hsotg_corereset(struct s3c_hsotg *hsotg)
                        return -ETIMEDOUT;
                }
 
-               if (grstctl & S3C_GRSTCTL_CSftRst)
-                       continue;
-
                if (!(grstctl & S3C_GRSTCTL_AHBIdle))
                        continue;