>
> Just a nitpick really, but what about parametrizing this code so we won't
> have
> two copies of the same loop?
>
> Say:
>
> uint32_t bit = low ? OTGSC_BSV : OTGSC_AWW;
> const char *name = low ? "B_SESS_VALID" : "A_VBUS_VALID";
>
> while (!(otgsc & bit)) {
> if (time_after(jiffies, timeout)) {
> dev_err(ci->dev, "wait vbus higher than\
> %s timeout!\n", name);
> return;
> }
> msleep(20);
> otgsc = hw_read(ci, OP_OTGSC, ~0);
> }
>
Good idea, I will change
> And shall we not be more careful about endless loops?
Yes, we should be careful of buggy hardware with vbus lower
very slow, so if timeout, return is needed.
>
> [...]
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html