diff --git a/drivers/mtd/spi/atmel.c b/drivers/mtd/spi/atmel.c
index 10fcf0cdde88d7d8b6d80c58d9bb0845258d1601..a5f51caf460b1a3cedf374307f56c7d741150921 100644
--- a/drivers/mtd/spi/atmel.c
+++ b/drivers/mtd/spi/atmel.c
@@ -39,9 +39,10 @@ struct atmel_spi_flash_params {
 	const char	*name;
 };
 
+/* spi_flash needs to be first so upper layers can free() it */
 struct atmel_spi_flash {
-	const struct atmel_spi_flash_params *params;
 	struct spi_flash flash;
+	const struct atmel_spi_flash_params *params;
 };
 
 static inline struct atmel_spi_flash *
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index 86324e4e1da81773c7cb91261992a0c4d0dc8d8c..e7dda91a407788093ef7d216e99f4a825a8f4c98 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -64,9 +64,10 @@ struct stmicro_spi_flash_params {
 	const char *name;
 };
 
+/* spi_flash needs to be first so upper layers can free() it */
 struct stmicro_spi_flash {
-	const struct stmicro_spi_flash_params *params;
 	struct spi_flash flash;
+	const struct stmicro_spi_flash_params *params;
 };
 
 static inline struct stmicro_spi_flash *to_stmicro_spi_flash(struct spi_flash