Skip to content

Commit

Permalink
spi: core: Add spi_transfer_is_last() helper
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Beniamino Galvani authored and Mark Brown committed Nov 24, 2014
1 parent 5d01410 commit b671358
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/linux/spi/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1049,4 +1049,10 @@ spi_unregister_device(struct spi_device *spi)
extern const struct spi_device_id *
spi_get_device_id(const struct spi_device *sdev);

static inline bool
spi_transfer_is_last(struct spi_master *master, struct spi_transfer *xfer)
{
return list_is_last(&xfer->transfer_list, &master->cur_msg->transfers);
}

#endif /* __LINUX_SPI_H */

0 comments on commit b671358

Please sign in to comment.