Commit edba9bf9 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Grant Likely

spi/bitbang: (cosmetic) simplify list manipulation

Use a proper list iterator instead of an open-coded loop and remove a
superfluous list head initialisation.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent b82b576b
...@@ -260,11 +260,11 @@ static void bitbang_work(struct work_struct *work) ...@@ -260,11 +260,11 @@ static void bitbang_work(struct work_struct *work)
struct spi_bitbang *bitbang = struct spi_bitbang *bitbang =
container_of(work, struct spi_bitbang, work); container_of(work, struct spi_bitbang, work);
unsigned long flags; unsigned long flags;
struct spi_message *m, *_m;
spin_lock_irqsave(&bitbang->lock, flags); spin_lock_irqsave(&bitbang->lock, flags);
bitbang->busy = 1; bitbang->busy = 1;
while (!list_empty(&bitbang->queue)) { list_for_each_entry_safe(m, _m, &bitbang->queue, queue) {
struct spi_message *m;
struct spi_device *spi; struct spi_device *spi;
unsigned nsecs; unsigned nsecs;
struct spi_transfer *t = NULL; struct spi_transfer *t = NULL;
...@@ -273,9 +273,7 @@ static void bitbang_work(struct work_struct *work) ...@@ -273,9 +273,7 @@ static void bitbang_work(struct work_struct *work)
int status; int status;
int do_setup = -1; int do_setup = -1;
m = container_of(bitbang->queue.next, struct spi_message, list_del(&m->queue);
queue);
list_del_init(&m->queue);
spin_unlock_irqrestore(&bitbang->lock, flags); spin_unlock_irqrestore(&bitbang->lock, flags);
/* FIXME this is made-up ... the correct value is known to /* FIXME this is made-up ... the correct value is known to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment