LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] omap-mcspi: When overriding SPI settings do not clobber status return value
@ 2015-03-04 16:35 David Bender
  0 siblings, 0 replies; only message in thread
From: David Bender @ 2015-03-04 16:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: David Bender, Dave Bender

The call to omap2_mcspi_setup_transfer(spi, NULL) clobbers the previous
status value, possibly masking hardware transfer errors. Instead record
a separate status for this call. Give preference to reporting a hardware
transfer error over any error returned by omap2_mcspi_setup_transfer()

Signed-off-by: Dave Bender <bender@benegon.com>
---
 drivers/spi/spi-omap2-mcspi.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 4df8942..6a4bd08 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1180,8 +1180,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)
-- 
1.7.8.6


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-04 16:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-04 16:35 [PATCH] omap-mcspi: When overriding SPI settings do not clobber status return value David Bender

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).