/* Transfer a message to a specified SPI slave @dev SPI slave @msg message to transfer  */
static int spi_m2s_transfer(struct spi_device *dev, struct spi_message *msg)
/* Transfer a message to a specified SPI slave @dev SPI slave @msg message to transfer  */
static int spi_m2s_transfer(struct spi_device *dev, struct spi_message *msg)
{
	struct m2s_spi_dsc *s = spi_master_get_devdata(dev->master);
	unsigned long f;
	int ret = 0;
	if (s->stopping) {
		ret = -ESHUTDOWN;
		goto done;
	}
	if (unlikely(list_empty(&msg->transfers))) {
		ret = -EINVAL;
		goto done;
	}
	msg->status = -EINPROGRESS;
	msg->actual_length = 0;
	spin_lock_irqsave(&s->lock, f);
	list_add_tail(&msg->queue, &s->queue);
	spin_unlock_irqrestore(&s->lock, f);
	schedule_work(&s->work);
done:
	return ret;
}