On Wed, Apr 27, 2011 at 7:56 AM, Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net wrote:
Am 22.04.2011 06:31 schrieb David Hendricks:
Index: internal.c
--- internal.c (revision 1288) +++ internal.c (working copy) @@ -164,6 +164,7 @@ } free(arg);
- register_shutdown(internal_shutdown, NULL);
get_io_perms();
Wrong order. We want to register the shutdown function only after we got IO permissions. That said, should get_io_perms automatically register release_io_perms? This would kill a few useless shutdown functions.
I like this idea of everybody cleaning up after themselfes.
Index: it85spi.c
--- it85spi.c (revision 1288) +++ it85spi.c (working copy) @@ -80,6 +80,8 @@ #define INDIRECT_WRITE(base, value) OUTB(value, (base) + 4) #endif /* LPC_IO */
+void it85xx_shutdown(void *);
This should go away, rather make the function static instead.
#ifdef LPC_IO unsigned int shm_io_base; #endif @@ -308,6 +310,7 @@ /* Set this as spi controller. */ spi_controller = SPI_CONTROLLER_IT85XX;
- register_shutdown(it85xx_shutdown, NULL);
return 0; }
@@ -349,11 +352,10 @@ return ret; }
-int it85xx_shutdown(void) +void it85xx_shutdown(void *data) { msg_pdbg("%s():%d\n", __func__, __LINE__); it85xx_exit_scratch_rom();
- return 0;
}
And move it above the register_... function.
-- Stefan Reinauer Google Inc.