linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: b.galvani@gmail.com (Beniamino Galvani)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/4] spi: core: Add spi_transfer_is_last() helper
Date: Sat, 22 Nov 2014 16:21:39 +0100	[thread overview]
Message-ID: <1416669702-7841-2-git-send-email-b.galvani@gmail.com> (raw)
In-Reply-To: <1416669702-7841-1-git-send-email-b.galvani@gmail.com>

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>
---
 include/linux/spi/spi.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 46d188a..a6ef2a8 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -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 */
-- 
1.9.1

  reply	other threads:[~2014-11-22 15:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-22 15:21 [PATCH v3 0/4] spi: Add support for Amlogic Meson SPIFC Beniamino Galvani
2014-11-22 15:21 ` Beniamino Galvani [this message]
2014-11-24 18:53   ` [PATCH v3 1/4] spi: core: Add spi_transfer_is_last() helper Mark Brown
2014-11-22 15:21 ` [PATCH v3 2/4] spi: meson: Add device tree bindings documentation for SPIFC Beniamino Galvani
2014-11-24 18:54   ` Mark Brown
2014-11-22 15:21 ` [PATCH v3 3/4] spi: meson: Add support for Amlogic Meson SPIFC Beniamino Galvani
2014-11-24 18:55   ` Mark Brown
2014-11-22 15:21 ` [PATCH v3 4/4] ARM: dts: meson: add node for SPIFC Beniamino Galvani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416669702-7841-2-git-send-email-b.galvani@gmail.com \
    --to=b.galvani@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).