/* This function moves though the linked list of spi transfers in the current spi message and returns with the state of current spi message i.e whether its last transfer is done(STATE_DONE) or Next transfer is ready(STATE_RUNNING)  */
static void* next_transfer(struct pl022 *pl022)
/* This function moves though the linked list of spi transfers in the current spi message and returns with the state of current spi message i.e whether its last transfer is done(STATE_DONE) or Next transfer is ready(STATE_RUNNING)  */
static void* next_transfer(struct pl022 *pl022)
{
	struct spi_message *msg = pl022->cur_msg;
	struct spi_transfer *trans = pl022->cur_transfer;
	if (trans->transfer_list.next != &msg->transfers) {
		pl022->cur_transfer =
		    list_entry(trans->transfer_list.next,
			       struct spi_transfer, transfer_list);
		return STATE_RUNNING;
	}
	return STATE_DONE;
}