Author: Lars-Peter Clausen <lars@metafoo.de> Quite often the pattern used for setting up and transferring a synchronous SPI transaction looks very much like the following: struct spi_message msg; struct spi_transfer xfers[] = { … }; spi_message_init(&msg); spi_message_add_tail(&xfers[0], &msg); … spi_message_add_tail(&xfers[ARRAY_SIZE(xfers) – 1], &msg); ret = spi_sync(&msg); This patch adds two new helper functions for handling this …