static int ath79_spi_setup(struct spi_device *spi) { int status = 0; if (spi->bits_per_word > 32) return -EINVAL; if (!spi->controller_state) { status = ath79_spi_setup_cs(spi); if (status) return status; } status = spi_bitbang_setup(spi); if (status && !spi->controller_state) ath79_spi_cleanup_cs(spi); return status; }
static void ath79_spi_cleanup(struct spi_device *spi) { ath79_spi_cleanup_cs(spi); spi_bitbang_cleanup(spi); }