@@ -127,6 +127,7 @@ void __init sh7786_usb_use_exclock(void)
static void __init sh7786_usb_setup(void)
{
int i = 1000000;
+ u32 val;
/*
* USB initial settings
@@ -143,14 +144,15 @@ static void __init sh7786_usb_setup(void)
* Set the PHY and PLL enable bit
*/
__raw_writel(PHY_ENB | PLL_ENB, USBPCTL1);
- while (i-- &&
- ((__raw_readl(USBST) & ACT_PLL_STATUS) != ACT_PLL_STATUS))
+ while (i--) {
+ val = __raw_readl(USBST) & ACT_PLL_STATUS;
+ if (ACT_PLL_STATUS == val) {
+ /* Set the PHY RST bit */
+ __raw_writel(PHY_ENB | PLL_ENB | PHY_RST, USBPCTL1);
+ printk(KERN_INFO "sh7786 usb setup done\n");
+ break;
+ }
cpu_relax();
-
- if (i) {
- /* Set the PHY RST bit */
- __raw_writel(PHY_ENB | PLL_ENB | PHY_RST, USBPCTL1);
- printk(KERN_INFO "sh7786 usb setup done\n");
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in