aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2014-12-10 12:40:53 -0500
committerMark Brown <broonie@kernel.org>2014-12-11 07:23:13 -0500
commit5424d43e4daddf71aaa60d6565c8816af9150adf (patch)
tree29672ed362f7400297f00a1671fc74932a7de449
parent0e647037fed5632e7c5989ec359ab84c676888ac (diff)
spi: Move queue data structure initialisation to main master init
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>
-rw-r--r--drivers/spi/spi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index da7e6225b8f6..b81ccdb1bc16 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -989,9 +989,6 @@ static int spi_init_queue(struct spi_master *master)
989{ 989{
990 struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 }; 990 struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
991 991
992 INIT_LIST_HEAD(&master->queue);
993 spin_lock_init(&master->queue_lock);
994
995 master->running = false; 992 master->running = false;
996 master->busy = false; 993 master->busy = false;
997 994
@@ -1595,6 +1592,8 @@ int spi_register_master(struct spi_master *master)
1595 dynamic = 1; 1592 dynamic = 1;
1596 } 1593 }
1597 1594
1595 INIT_LIST_HEAD(&master->queue);
1596 spin_lock_init(&master->queue_lock);
1598 spin_lock_init(&master->bus_lock_spinlock); 1597 spin_lock_init(&master->bus_lock_spinlock);
1599 mutex_init(&master->bus_lock_mutex); 1598 mutex_init(&master->bus_lock_mutex);
1600 master->bus_lock_flag = 0; 1599 master->bus_lock_flag = 0;