Skip to content

Commit

Permalink
spi: Move queue data structure initialisation to main master init
Browse files Browse the repository at this point in the history
Since most devices now do use the standard queue and in order to avoid
initialisation ordering issues being introduced by further refactorings
to improve performance move the initialisation of the queue and the lock
for it to the main master allocation.

Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Mark Brown committed Dec 11, 2014
1 parent 0e64703 commit 5424d43
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,6 @@ static int spi_init_queue(struct spi_master *master)
{
struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };

INIT_LIST_HEAD(&master->queue);
spin_lock_init(&master->queue_lock);

master->running = false;
master->busy = false;

Expand Down Expand Up @@ -1595,6 +1592,8 @@ int spi_register_master(struct spi_master *master)
dynamic = 1;
}

INIT_LIST_HEAD(&master->queue);
spin_lock_init(&master->queue_lock);
spin_lock_init(&master->bus_lock_spinlock);
mutex_init(&master->bus_lock_mutex);
master->bus_lock_flag = 0;
Expand Down

0 comments on commit 5424d43

Please sign in to comment.