/* Set up the SPI controller for a specified SPI slave device @dev SPI slave  */
static int spi_m2s_setup(struct spi_device *dev)
/* Set up the SPI controller for a specified SPI slave device @dev SPI slave  */
static int spi_m2s_setup(struct spi_device *dev)
{
	struct m2s_spi_dsc *s = spi_master_get_devdata(dev->master);
	int ret = 0;
	if (s->stopping) {
		ret = -ESHUTDOWN;
		goto done;
	}
	if (spi_m2s_hw_bt_check(s, dev->bits_per_word)) {
		dev_err(&dev->dev, "unsupported bits per word %d\n",
			dev->bits_per_word);
		ret = -EINVAL;
		goto done;
	}
	s->slave = NULL;
done:
	return ret;
}