Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 078726ce authored by Sourav Poddar's avatar Sourav Poddar Committed by Mark Brown
Browse files

driver: spi: Modify core to compute the message length



Make spi core calculate the message length while
populating the other transfer parameters.

Usecase, driver can use it to populate framelength filed in their
controller.

Signed-off-by: default avatarSourav Poddar <sourav.poddar@ti.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent ad81f054
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1375,6 +1375,7 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
	 * it is not set for this transfer.
	 */
	list_for_each_entry(xfer, &message->transfers, transfer_list) {
		message->frame_length += xfer->len;
		if (!xfer->bits_per_word)
			xfer->bits_per_word = spi->bits_per_word;
		if (!xfer->speed_hz)
+1 −0
Original line number Diff line number Diff line
@@ -578,6 +578,7 @@ struct spi_message {
	/* completion is reported through a callback */
	void			(*complete)(void *context);
	void			*context;
	unsigned		frame_length;
	unsigned		actual_length;
	int			status;