Merge branch 'spi-5.3' into spi-linus
authorMark Brown <broonie@kernel.org>
Sun, 15 Sep 2019 09:32:04 +0000 (10:32 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 15 Sep 2019 09:32:04 +0000 (10:32 +0100)
1  2 
drivers/spi/spi-bcm-qspi.c
drivers/spi/spi-uniphier.c

index 902bdbfedea8752099c1772b4026b61fb4fa0464,285a6f463013b0b2a919e92ac063b23359dc8bf3..0dbfd2496ab8f5a2a62a97baf467537e417a0133
@@@ -1,8 -1,19 +1,8 @@@
 +// SPDX-License-Identifier: GPL-2.0-only
  /*
   * Driver for Broadcom BRCMSTB, NSP,  NS2, Cygnus SPI Controllers
   *
   * Copyright 2016 Broadcom
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License, version 2, as
 - * published by the Free Software Foundation (the "GPL").
 - *
 - * This program is distributed in the hope that it will be useful, but
 - * WITHOUT ANY WARRANTY; without even the implied warranty of
 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 - * General Public License version 2 (GPLv2) for more details.
 - *
 - * You should have received a copy of the GNU General Public License
 - * version 2 (GPLv2) along with this source code.
   */
  
  #include <linux/clk.h>
@@@ -343,7 -354,7 +343,7 @@@ static int bcm_qspi_bspi_set_flex_mode(
  {
        int bpc = 0, bpp = 0;
        u8 command = op->cmd.opcode;
-       int width  = op->cmd.buswidth ? op->cmd.buswidth : SPI_NBITS_SINGLE;
+       int width = op->data.buswidth ? op->data.buswidth : SPI_NBITS_SINGLE;
        int addrlen = op->addr.nbytes;
        int flex_mode = 1;
  
@@@ -981,7 -992,7 +981,7 @@@ static int bcm_qspi_exec_mem_op(struct 
        if (mspi_read)
                return bcm_qspi_mspi_exec_mem_op(spi, op);
  
-       ret = bcm_qspi_bspi_set_mode(qspi, op, -1);
+       ret = bcm_qspi_bspi_set_mode(qspi, op, 0);
  
        if (!ret)
                ret = bcm_qspi_bspi_exec_mem_op(spi, op);
index b32c77df5d49cf8acd5c253d9f6965909383e834,50f12fb20403d450bea6a178cd73f3b36b60ff35..4e99a0f25c298874f353f555f4a2143edf0b510d
@@@ -214,6 -214,7 +214,7 @@@ static void uniphier_spi_setup_transfer
        if (!priv->is_save_param || priv->mode != spi->mode) {
                uniphier_spi_set_mode(spi);
                priv->mode = spi->mode;
+               priv->is_save_param = false;
        }
  
        if (!priv->is_save_param || priv->bits_per_word != t->bits_per_word) {
@@@ -328,12 -329,7 +329,12 @@@ static int uniphier_spi_transfer_one(st
                                     struct spi_transfer *t)
  {
        struct uniphier_spi_priv *priv = spi_master_get_devdata(master);
 -      int status;
 +      struct device *dev = master->dev.parent;
 +      unsigned long time_left;
 +
 +      /* Terminate and return success for 0 byte length transfer */
 +      if (!t->len)
 +              return 0;
  
        uniphier_spi_setup_transfer(spi, t);
  
  
        uniphier_spi_irq_enable(spi, SSI_IE_RCIE | SSI_IE_RORIE);
  
 -      status = wait_for_completion_timeout(&priv->xfer_done,
 -                                           msecs_to_jiffies(SSI_TIMEOUT_MS));
 +      time_left = wait_for_completion_timeout(&priv->xfer_done,
 +                                      msecs_to_jiffies(SSI_TIMEOUT_MS));
  
        uniphier_spi_irq_disable(spi, SSI_IE_RCIE | SSI_IE_RORIE);
  
 -      if (status < 0)
 -              return status;
 +      if (!time_left) {
 +              dev_err(dev, "transfer timeout.\n");
 +              return -ETIMEDOUT;
 +      }
  
        return priv->error;
  }