]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi: Move queue data structure initialisation to main master init
authorMark Brown <broonie@kernel.org>
Wed, 10 Dec 2014 17:40:53 +0000 (17:40 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 11 Dec 2014 12:23:13 +0000 (12:23 +0000)
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>
drivers/spi/spi.c

index da7e6225b8f60533492fbdc3f8595d70b24f6bf6..b81ccdb1bc16a5f5b018f1a008d6a882bcda744c 100644 (file)
@@ -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;
 
@@ -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;