spi: bitbang: Don't call chipselect() in spi_bitbang_setup()
authorAlban Bedel <albeu@free.fr>
Wed, 16 Jan 2019 18:55:44 +0000 (19:55 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 17 Jan 2019 12:34:14 +0000 (12:34 +0000)
spi_setup() already call spi_set_cs() right after calling the
controller setup method, so there is no need for the bitbang driver to
do that. Because of this the chipselect() callback was confusingly
still called when CS is GPIO based.

Signed-off-by: Alban Bedel <albeu@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bitbang.c

index f29176000b8df1b0839f5030d8d046fbd07a8ef1..dd9a8c54a693ba6687049cc3d2d56836ecaadbbb 100644 (file)
@@ -213,19 +213,6 @@ int spi_bitbang_setup(struct spi_device *spi)
 
        dev_dbg(&spi->dev, "%s, %u nsec/bit\n", __func__, 2 * cs->nsecs);
 
-       /* NOTE we _need_ to call chipselect() early, ideally with adapter
-        * setup, unless the hardware defaults cooperate to avoid confusion
-        * between normal (active low) and inverted chipselects.
-        */
-
-       /* deselect chip (low or high) */
-       mutex_lock(&bitbang->lock);
-       if (!bitbang->busy) {
-               bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
-               ndelay(cs->nsecs);
-       }
-       mutex_unlock(&bitbang->lock);
-
        return 0;
 }
 EXPORT_SYMBOL_GPL(spi_bitbang_setup);