[U-Boot] [PATCH v8 4/4] Add USB support for Efika

Jana Rapava
2011-09-28T18:12:08Z

2011/9/28 Marek Vasut <marek.vasut.n900@gmail.com>

> > + if (!timeout)
> > + return -1;
> > + else
> > + return tmp;
> > +}
>
> Won't 'return !timeout;' be enough?
>
> > + tmp = ulpi_wait(ehci, ULPI_RWRUN);
> + if (tmp == -1) {
> + printf("ULPI read timed out\n");
> + return 0;
> + }
> + return ulpi_read_mask(tmp);
> +}

Here in ulpi_read() I need to store and return value which was read in
ulpi_wait(). What is the proper way to do this, If ulpi_wait() should return
!timeout ?

> Also, can you change 'ulpi_bit' to 'ulpi_mask'? That seems more
> appropriate.
>
> Maybe this can be even changed to ulpi_wait(ehci, value_to_be_written,
> bit_to_be_polled), then you won't need those writel()s before every write to
> ulpi anymore.
>

Ok.

> cheers
>