int parport_poll_peripheral (struct parport * port, unsigned char mask, unsigned char result, int usec);
This function busy-waits until the masked status lines have the desired values, or until the timeout period elapses. The mask and result parameters are bitmasks, with the bits defined by the constants in parport.h: PARPORT_STATUS_BUSY, and so on.
This function does not call schedule; instead it busy-waits using udelay. It currently has a resolution of 5usec.
If the status lines take on the desired values before the timeout period elapses, parport_poll_peripheral returns zero immediately. A zero return value greater than zero indicates a timeout. An error code (less than zero) indicates an error, most likely a signal that arrived, and the caller should finish what it is doing as soon as possible.