/* flush - flush the FIFO to reach a clean state @pl022: SSP driver private data structure  */
static int flush(struct pl022 *pl022)
/* flush - flush the FIFO to reach a clean state @pl022: SSP driver private data structure  */
static int flush(struct pl022 *pl022)
{
	unsigned long limit = loops_per_jiffy << 1;
	dev_dbg(&pl022->adev->dev, "flush\n");
	do {
		while (readw(SSP_SR(pl022->virtbase)) & SSP_SR_MASK_RNE)
			readw(SSP_DR(pl022->virtbase));
	} while ((readw(SSP_SR(pl022->virtbase)) & SSP_SR_MASK_BSY) && limit--);
	return limit;
}