summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-04-26 16:13:09 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-04-26 16:13:09 +0000
commit59c4d790bd5cc172041f780e103a85eb1595c23f (patch)
tree649c9bf865c2160cdd0802bcd3246ea03a8d9cc7
parent87ace663df470f7aadc5f5a71258d43f743f05a9 (diff)
downloadast2050-flashrom-59c4d790bd5cc172041f780e103a85eb1595c23f.zip
ast2050-flashrom-59c4d790bd5cc172041f780e103a85eb1595c23f.tar.gz
Report if we are not able to disable AAI mode again
Corresponding to flashrom svn r1780. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
-rw-r--r--spi25.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/spi25.c b/spi25.c
index 69be073..f660ad1 100644
--- a/spi25.c
+++ b/spi25.c
@@ -1151,10 +1151,12 @@ int default_spi_write_aai(struct flashctx *flash, uint8_t *buf, unsigned int sta
programmer_delay(10);
}
- /* Use WRDI to exit AAI mode. This needs to be done before issuing any
- * other non-AAI command.
- */
- spi_write_disable(flash);
+ /* Use WRDI to exit AAI mode. This needs to be done before issuing any other non-AAI command. */
+ result = spi_write_disable(flash);
+ if (result != 0) {
+ msg_cerr("%s failed to disable AAI mode.\n", __func__);
+ return SPI_GENERIC_ERROR;
+ }
/* Write remaining byte (if any). */
if (pos < start + len) {
@@ -1166,6 +1168,8 @@ int default_spi_write_aai(struct flashctx *flash, uint8_t *buf, unsigned int sta
return 0;
bailout:
- spi_write_disable(flash);
+ result = spi_write_disable(flash);
+ if (result != 0)
+ msg_cerr("%s failed to disable AAI mode.\n", __func__);
return SPI_GENERIC_ERROR;
}
OpenPOWER on IntegriCloud