/* This function is registered to the SPI framework for this SPI master controller. It will queue the spi_message in the queue of driver if the queue is not stopped and return.  */
static int pl022_transfer(struct spi_device *spi, struct spi_message *msg)
/* This function is registered to the SPI framework for this SPI master controller. It will queue the spi_message in the queue of driver if the queue is not stopped and return.  */
static int pl022_transfer(struct spi_device *spi, struct spi_message *msg)
{
	struct pl022 *pl022 = spi_master_get_devdata(spi->master);
	unsigned long flags;
	spin_lock_irqsave(&pl022->queue_lock, flags);
	if (!pl022->running) {
		spin_unlock_irqrestore(&pl022->queue_lock, flags);
		return -ESHUTDOWN;
	}
	msg->actual_length = 0;
	msg->status = -EINPROGRESS;
	msg->state = STATE_START;
	list_add_tail(&msg->queue, &pl022->queue);
	if (pl022->running && !pl022->busy)
		queue_kthread_work(&pl022->kworker, &pl022->pump_messages);
	spin_unlock_irqrestore(&pl022->queue_lock, flags);
	return 0;
}