Index: wpce775x.c |
diff --git a/wpce775x.c b/wpce775x.c |
index f394e64b6fb8d132bd9468233a905c2fc648850f..7bdae6236d83d4eed03ce8b8bfdd6f3851138178 100644 |
--- a/wpce775x.c |
+++ b/wpce775x.c |
@@ -52,6 +52,8 @@ |
#include "spi.h" |
#include "writeprotect.h" |
+void wpce775x_shutdown(void *); |
Stefan Reinauer
2011/04/27 20:34:05
delete this.
dhendrix
2011/04/27 21:15:05
Done.
|
+ |
/** |
* Definition of WPCE775X WCB (Write Command Buffer), as known as Shared Access |
* Window 2. |
@@ -592,6 +594,9 @@ int wpce775x_spi_common_init(void) |
/* TODO: set fwh_idsel of chipset. |
Currently, we employ "-p internal:fwh_idsel=0x0000223e". */ |
+ if (register_shutdown(wpce775x_shutdown, NULL)) |
+ return 1; |
+ |
/* Enter flash update mode unconditionally. This is required even |
for reading. */ |
if (EnterFlashUpdate()) return 1; |
@@ -599,13 +604,12 @@ int wpce775x_spi_common_init(void) |
spi_controller = SPI_CONTROLLER_WPCE775X; |
msg_pdbg("%s(): successfully initialized wpce775x\n", __func__); |
return 0; |
- |
} |
-int wpce775x_shutdown(void) |
+void wpce775x_shutdown(void *data) |
Stefan Reinauer
2011/04/27 20:34:05
static and move before register
dhendrix
2011/04/27 21:15:05
Done.
|
{ |
if (spi_controller != SPI_CONTROLLER_WPCE775X) |
- return 0; |
+ return; |
msg_pdbg("%s(): firmware %s\n", __func__, |
firmware_changed ? "changed" : "not changed"); |
@@ -624,8 +628,6 @@ int wpce775x_shutdown(void) |
free(initflash_cfg); |
else |
msg_perr("%s(): No initflash_cfg to free?!?\n", __func__); |
- |
- return 0; |
} |
/* Called by internal_init() */ |