/* called only when no transfer is active on the bus  */
static int orion_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
/* called only when no transfer is active on the bus  */
static int orion_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
{
	struct orion_spi *orion_spi;
	unsigned int speed = spi->max_speed_hz;
	unsigned int bits_per_word = spi->bits_per_word;
	int	rc;
	orion_spi = spi_master_get_devdata(spi->master);
	if ((t != NULL) && t->speed_hz)
		speed = t->speed_hz;
	if ((t != NULL) && t->bits_per_word)
		bits_per_word = t->bits_per_word;
	rc = orion_spi_baudrate_set(spi, speed);
	if (rc)
		return rc;
	return orion_spi_set_transfer_size(orion_spi, bits_per_word);
}