[PATCH v7] introduce macro spin_event_timeout()
Sean MacLennan
smaclennan at pikatech.com
Wed May 6 10:43:18 EST 2009
On Tue, 5 May 2009 16:53:05 -0500
"Timur Tabi" <timur at freescale.com> wrote:
> The macro spin_event_timeout() takes a condition and timeout value
> (in microseconds) as parameters. It spins until either the condition
> is true or the timeout expires. It returns the result of the
> condition when the loop was terminated.
>
> This primary purpose of this macro is to poll on a hardware register
> until a status bit changes. The timeout ensures that the loop still
> terminates if the bit doesn't change as expected. This macro makes
> it easier for driver developers to perform this kind of operation
> properly.
>
> Signed-off-by: Timur Tabi <timur at freescale.com>
Nice. I could have used a routine like this in a couple of our drivers.
So, for what it is worth:
Acked-by: Sean MacLennan <smaclennan at pikatech.com>
Cheers,
Sean
More information about the Linuxppc-dev
mailing list