diff options
author | Beniamino Galvani <b.galvani@gmail.com> | 2014-11-22 10:21:39 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-24 13:53:42 -0500 |
commit | b671358ad7916beb7ca9e5c304ae88afc7da4557 (patch) | |
tree | ee79ebf66aa09c33baac5530127674c8fc5b9ad3 /include/linux/spi | |
parent | 5d01410fe4d92081f349b013a2e7a95429e4f2c9 (diff) |
spi: core: Add spi_transfer_is_last() helper
This adds the function spi_transfer_is_last() which can be used by
drivers to know whether a given transfer is the last one in the
current message.
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/spi')
-rw-r--r-- | include/linux/spi/spi.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 46d188a9947c..a6ef2a8e6de4 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -1049,4 +1049,10 @@ spi_unregister_device(struct spi_device *spi) | |||
1049 | extern const struct spi_device_id * | 1049 | extern const struct spi_device_id * |
1050 | spi_get_device_id(const struct spi_device *sdev); | 1050 | spi_get_device_id(const struct spi_device *sdev); |
1051 | 1051 | ||
1052 | static inline bool | ||
1053 | spi_transfer_is_last(struct spi_master *master, struct spi_transfer *xfer) | ||
1054 | { | ||
1055 | return list_is_last(&xfer->transfer_list, &master->cur_msg->transfers); | ||
1056 | } | ||
1057 | |||
1052 | #endif /* __LINUX_SPI_H */ | 1058 | #endif /* __LINUX_SPI_H */ |