/* Set up the SPI controller for a specified SPI slave device  */
static int spi_stm32_setup(struct spi_device *s)
/* Set up the SPI controller for a specified SPI slave device  */
static int spi_stm32_setup(struct spi_device *s)
{
	struct spi_stm32 *c = spi_master_get_devdata(s->master);
	int ret = 0;
	if (c->stopping) {
		ret = -ESHUTDOWN;
		goto Done;
	}
	if (spi_stm32_hw_bt_check(c, s->bits_per_word)) {
		dev_err(&s->dev, "unsupported bits per word %d\n", 
			s->bits_per_word);
		ret = -EINVAL;
		goto Done;
	}
	spi_stm32_release_slave(c, s);
Done:
	d_printk(1, "slv=%s,spd=%d,cs=%d,bt=%d,md=0x%x,ret=%d\n",
		 dev_name(&s->dev), s->max_speed_hz,
		 s->chip_select, s->bits_per_word, s->mode, ret);
	return ret;
}