ieee1394/amdtp: use poll_event*() interface
RFC PATCH 5/5 ieee1394/amdtp: use poll_event*() interface
Hi,
Description: Use new poll_event*() interface to encapsulate sleep-loops.
Signed-off-by Nishanth Aravamudan <[email protected]>
drivers/ieee1394/amdtp.c +6 -10
@@ -83,6 +83,7 @@#include <linux/ioctl32.h> #include <linux/compat.h> #include <linux/cdev.h> +#include <linux/delay.h> #include <asm/uaccess.h> #include <asm/atomic.h>
@@ -314,16 +315,11 @@ void ohci1394_stop_it_ctx(struct ti_ohci OHCI1394_CONTEXT_RUN);wmb (); -if (synchronous) { -for (wait =0 ; wait <5 ; wait++) { - control =reg_read (ohci, OHCI1394_IsoXmitContextControlSet + ctx *16 ); -if ((control &OHCI1394_CONTEXT_ACTIVE ) ==0 ) -break ; - -set_current_state (TASK_INTERRUPTIBLE ); -schedule_timeout (1 ); - } - } +if (synchronous) +/* check every ms for condition, up to 5 ms */ +poll_event_interruptible_timeout ((reg_read (ohci, + OHCI1394_IsoXmitContextControlSet + ctx *16 ) & +OHCI1394_CONTEXT_ACTIVE ==0 ),1 ,5 ); }/* Note: we can test if free_packet_lists is empty without aquiring
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors