Have all shutdown functions take a flashctx argument
This is a patch related to Change 358012. In order to clean
up a hacky, inefficient way of retrieving the flashctx in dediprog.c
(in dediprog_set_spi_voltage_auto), we are now passing the flashctx
down to that function. However, this requires us to also pass the
flashctx into the dediprog_shutdown function, and thus to ALL shutdown
functions. However, this may be helpful in the future if flashctx specific
operations need to be performed in the shutdown process for each programmer.
BUG=none
BRANCH=none
TEST=reads/writes correctly to paine, but needs more testing
Change-Id: I6ff6992345a56772b0e1622f393d45834e929a7b
Signed-off-by: Souvik Ghosh <souvikghosh@google.com>
Reviewed-on: https://chromium-review.googlesource.com/359561
Reviewed-by: David Hendricks <dhendrix@chromium.org>
diff --git a/programmer.h b/programmer.h
index 1d7e5f1..c5653a9 100644
--- a/programmer.h
+++ b/programmer.h
@@ -131,7 +131,7 @@
extern const struct programmer_entry programmer_table[];
int programmer_init(struct flashctx *flash, enum programmer prog, char *param);
-int programmer_shutdown(void);
+int programmer_shutdown(struct flashctx *flash);
enum bitbang_spi_master_type {
BITBANG_SPI_INVALID = 0, /* This must always be the first entry. */
@@ -475,7 +475,7 @@
/* linux_i2c.c */
#if CONFIG_LINUX_I2C == 1
-int linux_i2c_shutdown(void *data);
+int linux_i2c_shutdown(struct flashctx *flash, void *data);
int linux_i2c_init(struct flashctx *flash);
int linux_i2c_open(int bus, int addr, int force);
void linux_i2c_close(void);