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

Commit 1cfd97f9 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

spi: core: Use list_first_entry_or_null() instead of open-coded



Use list_first_entry_or_null() to save a few lines.

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 368ca4e0
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -791,11 +791,8 @@ struct spi_message *spi_get_next_queued_message(struct spi_master *master)

	/* get a pointer to the next message, if any */
	spin_lock_irqsave(&master->queue_lock, flags);
	if (list_empty(&master->queue))
		next = NULL;
	else
		next = list_entry(master->queue.next,
				  struct spi_message, queue);
	next = list_first_entry_or_null(&master->queue, struct spi_message,
					queue);
	spin_unlock_irqrestore(&master->queue_lock, flags);

	return next;