[PATCH] omap2-mcspi: when overriding spi settings, don't clobber IO error on calling omap2_mcspi_setup_transfer

Dave Bender codehero at gmail.com
Fri Oct 31 08:40:40 PDT 2014


Observed errors using spidev (erroneously on the userspace I may add)
and traced it to a bug in omap2-mcspi.c clobbering the status:

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index d7e52c2..4fda762 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1153,8 +1153,10 @@ static void omap2_mcspi_work(struct omap2_mcspi
*mcspi, struct spi_message *m)
  }
  /* Restore defaults if they were overriden */
  if (par_override) {
+ int status_transfer;
  par_override = 0;
- status = omap2_mcspi_setup_transfer(spi, NULL);
+ status_transfer = omap2_mcspi_setup_transfer(spi, NULL);
+ status = status ? status : status_transfer;
  }

  if (cs_active)



More information about the linux-arm-kernel mailing list