Andy Green wrote:
> pcf50633.c shouldn't know GTAxx at all.
Yeah, glad to see that mess go ! ;-)
One nitpick:
> +int pcf50633_wait_for_ready(struct pcf50633_data *pcf, int timeout_ms,
> + char *name)
> +{
> + /* so we always go once */
> + timeout_ms += 5;
> +
> + while ((timeout_ms >= 5) && (pcf50633_ready(pcf))) {
> + timeout_ms -= 5; /* well, it isn't very accurate, but OK */
> + msleep(5);
> + }
> +
> + if (timeout_ms < 5) {
That seems a bit contorted. Why not just make the whole thing
zero-based ? BTW, not even Pascal makes you put parentheses around
functions returning a boolean ;-)
- Werner