Merge remote-tracking branch 'spi/fix/core' into spi-linus
authorMark Brown <broonie@kernel.org>
Wed, 4 Nov 2015 11:01:58 +0000 (11:01 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 4 Nov 2015 11:01:58 +0000 (11:01 +0000)
1  2 
drivers/spi/spi.c

diff --combined drivers/spi/spi.c
@@@ -1610,7 -1610,8 +1610,7 @@@ static struct class spi_master_class = 
   *
   * The caller is responsible for assigning the bus number and initializing
   * the master's methods before calling spi_register_master(); and (after errors
 - * adding the device) calling spi_master_put() and kfree() to prevent a memory
 - * leak.
 + * adding the device) calling spi_master_put() to prevent a memory leak.
   */
  struct spi_master *spi_alloc_master(struct device *dev, unsigned size)
  {
@@@ -1992,11 -1993,11 +1992,11 @@@ int spi_setup(struct spi_device *spi
        if (!spi->max_speed_hz)
                spi->max_speed_hz = spi->master->max_speed_hz;
  
-       spi_set_cs(spi, false);
        if (spi->master->setup)
                status = spi->master->setup(spi);
  
+       spi_set_cs(spi, false);
        dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s%u bits/w, %u Hz max --> %d\n",
                        (int) (spi->mode & (SPI_CPOL | SPI_CPHA)),
                        (spi->mode & SPI_CS_HIGH) ? "cs_high, " : "",