1 From 73d127565b5a4b19bcaacabc505689ee039f16fd Mon Sep 17 00:00:00 2001
2 From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 Date: Sun, 11 Nov 2012 03:11:38 +0100
4 Subject: sf: factor out malloc from SPI flash drivers
6 Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
8 --- a/drivers/mtd/spi/atmel.c
9 +++ b/drivers/mtd/spi/atmel.c
10 @@ -40,18 +40,6 @@ struct atmel_spi_flash_params {
14 -/* spi_flash needs to be first so upper layers can free() it */
15 -struct atmel_spi_flash {
16 - struct spi_flash flash;
17 - const struct atmel_spi_flash_params *params;
20 -static inline struct atmel_spi_flash *
21 -to_atmel_spi_flash(struct spi_flash *flash)
23 - return container_of(flash, struct atmel_spi_flash, flash);
26 static const struct atmel_spi_flash_params atmel_spi_flash_table[] = {
29 @@ -156,7 +144,8 @@ static int at45_wait_ready(struct spi_fl
30 * Assemble the address part of a command for AT45 devices in
31 * non-power-of-two page size mode.
33 -static void at45_build_address(struct atmel_spi_flash *asf, u8 *cmd, u32 offset)
34 +static void at45_build_address(const struct atmel_spi_flash_params *params,
35 + u8 *cmd, u32 offset)
37 unsigned long page_addr;
38 unsigned long byte_addr;
39 @@ -167,7 +156,7 @@ static void at45_build_address(struct at
40 * The "extra" space per page is the power-of-two page size
43 - page_shift = asf->params->l2_page_size;
44 + page_shift = params->l2_page_size;
45 page_size = (1 << page_shift) + (1 << (page_shift - 5));
47 page_addr = offset / page_size;
48 @@ -181,11 +170,11 @@ static void at45_build_address(struct at
49 static int dataflash_read_fast_at45(struct spi_flash *flash,
50 u32 offset, size_t len, void *buf)
52 - struct atmel_spi_flash *asf = to_atmel_spi_flash(flash);
53 + const struct atmel_spi_flash_params *params = flash->priv;
56 cmd[0] = CMD_READ_ARRAY_FAST;
57 - at45_build_address(asf, cmd + 1, offset);
58 + at45_build_address(params, cmd + 1, offset);
61 return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
62 @@ -197,7 +186,7 @@ static int dataflash_read_fast_at45(stru
63 static int dataflash_write_p2(struct spi_flash *flash,
64 u32 offset, size_t len, const void *buf)
66 - struct atmel_spi_flash *asf = to_atmel_spi_flash(flash);
67 + const struct atmel_spi_flash_params *params = flash->priv;
68 unsigned long page_size;
71 @@ -211,7 +200,7 @@ static int dataflash_write_p2(struct spi
72 * the other is being programmed into main memory.
75 - page_size = (1 << asf->params->l2_page_size);
76 + page_size = (1 << params->l2_page_size);
78 ret = spi_claim_bus(flash->spi);
80 @@ -263,7 +252,7 @@ out:
81 static int dataflash_write_at45(struct spi_flash *flash,
82 u32 offset, size_t len, const void *buf)
84 - struct atmel_spi_flash *asf = to_atmel_spi_flash(flash);
85 + const struct atmel_spi_flash_params *params = flash->priv;
86 unsigned long page_addr;
87 unsigned long byte_addr;
88 unsigned long page_size;
89 @@ -279,7 +268,7 @@ static int dataflash_write_at45(struct s
90 * the other is being programmed into main memory.
93 - page_shift = asf->params->l2_page_size;
94 + page_shift = params->l2_page_size;
95 page_size = (1 << page_shift) + (1 << (page_shift - 5));
97 page_addr = offset / page_size;
98 @@ -338,7 +327,7 @@ out:
100 static int dataflash_erase_p2(struct spi_flash *flash, u32 offset, size_t len)
102 - struct atmel_spi_flash *asf = to_atmel_spi_flash(flash);
103 + const struct atmel_spi_flash_params *params = flash->priv;
104 unsigned long page_size;
107 @@ -351,7 +340,7 @@ static int dataflash_erase_p2(struct spi
111 - page_size = (1 << asf->params->l2_page_size);
112 + page_size = (1 << params->l2_page_size);
114 if (offset % page_size || len % page_size) {
115 debug("SF: Erase offset/length not multiple of page size\n");
116 @@ -397,7 +386,7 @@ out:
118 static int dataflash_erase_at45(struct spi_flash *flash, u32 offset, size_t len)
120 - struct atmel_spi_flash *asf = to_atmel_spi_flash(flash);
121 + const struct atmel_spi_flash_params *params = flash->priv;
122 unsigned long page_addr;
123 unsigned long page_size;
124 unsigned int page_shift;
125 @@ -411,7 +400,7 @@ static int dataflash_erase_at45(struct s
129 - page_shift = asf->params->l2_page_size;
130 + page_shift = params->l2_page_size;
131 page_size = (1 << page_shift) + (1 << (page_shift - 5));
133 page_addr = offset / page_size;
134 @@ -458,12 +447,12 @@ out:
138 -struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
139 +int spi_flash_probe_atmel(struct spi_flash *flash, u8 *idcode)
141 const struct atmel_spi_flash_params *params;
142 + struct spi_slave *spi = flash->spi;
145 - struct atmel_spi_flash *asf;
149 @@ -477,18 +466,11 @@ struct spi_flash *spi_flash_probe_atmel(
150 if (i == ARRAY_SIZE(atmel_spi_flash_table)) {
151 debug("SF: Unsupported DataFlash ID %02x\n",
156 - asf = malloc(sizeof(struct atmel_spi_flash));
158 - debug("SF: Failed to allocate memory\n");
163 - asf->params = params;
164 - asf->flash.spi = spi;
165 - asf->flash.name = params->name;
166 + flash->priv = (void *)params;
167 + flash->name = params->name;
169 /* Assuming power-of-two page size initially. */
170 page_size = 1 << params->l2_page_size;
171 @@ -503,48 +485,44 @@ struct spi_flash *spi_flash_probe_atmel(
173 ret = spi_flash_cmd(spi, CMD_AT45_READ_STATUS, &status, 1);
178 debug("SF: AT45 status register: %02x\n", status);
180 if (!(status & AT45_STATUS_P2_PAGE_SIZE)) {
181 - asf->flash.read = dataflash_read_fast_at45;
182 - asf->flash.write = dataflash_write_at45;
183 - asf->flash.erase = dataflash_erase_at45;
184 + flash->read = dataflash_read_fast_at45;
185 + flash->write = dataflash_write_at45;
186 + flash->erase = dataflash_erase_at45;
187 page_size += 1 << (params->l2_page_size - 5);
189 - asf->flash.read = spi_flash_cmd_read_fast;
190 - asf->flash.write = dataflash_write_p2;
191 - asf->flash.erase = dataflash_erase_p2;
192 + flash->read = spi_flash_cmd_read_fast;
193 + flash->write = dataflash_write_p2;
194 + flash->erase = dataflash_erase_p2;
197 - asf->flash.page_size = page_size;
198 - asf->flash.sector_size = page_size;
199 + flash->page_size = page_size;
200 + flash->sector_size = page_size;
203 case DF_FAMILY_AT26F:
204 case DF_FAMILY_AT26DF:
205 - asf->flash.read = spi_flash_cmd_read_fast;
206 - asf->flash.write = spi_flash_cmd_write_multi;
207 - asf->flash.erase = spi_flash_cmd_erase;
208 - asf->flash.page_size = page_size;
209 - asf->flash.sector_size = 4096;
210 + flash->read = spi_flash_cmd_read_fast;
211 + flash->write = spi_flash_cmd_write_multi;
212 + flash->erase = spi_flash_cmd_erase;
213 + flash->page_size = page_size;
214 + flash->sector_size = 4096;
215 /* clear SPRL# bit for locked flash */
216 - spi_flash_cmd_write_status(&asf->flash, 0);
217 + spi_flash_cmd_write_status(flash, 0);
221 debug("SF: Unsupported DataFlash family %u\n", family);
226 - asf->flash.size = page_size * params->pages_per_block
227 + flash->size = page_size * params->pages_per_block
228 * params->blocks_per_sector
229 * params->nr_sectors;
231 - return &asf->flash;
238 --- a/drivers/mtd/spi/eon.c
239 +++ b/drivers/mtd/spi/eon.c
240 @@ -29,10 +29,9 @@ static const struct eon_spi_flash_params
244 -struct spi_flash *spi_flash_probe_eon(struct spi_slave *spi, u8 *idcode)
245 +int spi_flash_probe_eon(struct spi_flash *flash, u8 *idcode)
247 const struct eon_spi_flash_params *params;
248 - struct spi_flash *flash;
251 for (i = 0; i < ARRAY_SIZE(eon_spi_flash_table); ++i) {
252 @@ -43,16 +42,10 @@ struct spi_flash *spi_flash_probe_eon(st
254 if (i == ARRAY_SIZE(eon_spi_flash_table)) {
255 debug("SF: Unsupported EON ID %02x\n", idcode[1]);
260 - flash = malloc(sizeof(*flash));
262 - debug("SF: Failed to allocate memory\n");
267 + flash->priv = (void *)params;
268 flash->name = params->name;
270 flash->write = spi_flash_cmd_write_multi;
271 @@ -63,5 +56,5 @@ struct spi_flash *spi_flash_probe_eon(st
272 flash->size = 256 * 16
273 * params->nr_sectors;
278 --- a/drivers/mtd/spi/macronix.c
279 +++ b/drivers/mtd/spi/macronix.c
280 @@ -79,10 +79,9 @@ static const struct macronix_spi_flash_p
284 -struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode)
285 +int spi_flash_probe_macronix(struct spi_flash *flash, u8 *idcode)
287 const struct macronix_spi_flash_params *params;
288 - struct spi_flash *flash;
290 u16 id = idcode[2] | idcode[1] << 8;
292 @@ -94,16 +93,10 @@ struct spi_flash *spi_flash_probe_macron
294 if (i == ARRAY_SIZE(macronix_spi_flash_table)) {
295 debug("SF: Unsupported Macronix ID %04x\n", id);
300 - flash = malloc(sizeof(*flash));
302 - debug("SF: Failed to allocate memory\n");
307 + flash->priv = (void *)params;
308 flash->name = params->name;
310 flash->write = spi_flash_cmd_write_multi;
311 @@ -116,5 +109,5 @@ struct spi_flash *spi_flash_probe_macron
312 /* Clear BP# bits for read-only flash */
313 spi_flash_cmd_write_status(flash, 0);
318 --- a/drivers/mtd/spi/ramtron.c
319 +++ b/drivers/mtd/spi/ramtron.c
320 @@ -69,17 +69,6 @@ struct ramtron_spi_fram_params {
321 const char *name; /* name for display and/or matching */
324 -struct ramtron_spi_fram {
325 - struct spi_flash flash;
326 - const struct ramtron_spi_fram_params *params;
329 -static inline struct ramtron_spi_fram *to_ramtron_spi_fram(struct spi_flash
332 - return container_of(flash, struct ramtron_spi_fram, flash);
336 * table describing supported FRAM chips:
337 * chips without RDID command must have the values 0xff for id1 and id2
338 @@ -155,18 +144,18 @@ static const struct ramtron_spi_fram_par
339 static int ramtron_common(struct spi_flash *flash,
340 u32 offset, size_t len, void *buf, u8 command)
342 - struct ramtron_spi_fram *sn = to_ramtron_spi_fram(flash);
343 + const struct ramtron_spi_fram_params *params = flash->priv;
348 - if (sn->params->addr_len == 3 && sn->params->merge_cmd == 0) {
349 + if (params->addr_len == 3 && params->merge_cmd == 0) {
351 cmd[1] = offset >> 16;
352 cmd[2] = offset >> 8;
355 - } else if (sn->params->addr_len == 2 && sn->params->merge_cmd == 0) {
356 + } else if (params->addr_len == 2 && params->merge_cmd == 0) {
358 cmd[1] = offset >> 8;
360 @@ -230,10 +219,9 @@ static int ramtron_erase(struct spi_flas
361 * nore: we are called here with idcode pointing to the first non-0x7f byte
364 -struct spi_flash *spi_fram_probe_ramtron(struct spi_slave *spi, u8 *idcode)
365 +int spi_fram_probe_ramtron(struct spi_flash *flash, u8 *idcode)
367 const struct ramtron_spi_fram_params *params;
368 - struct ramtron_spi_fram *sn;
370 #ifdef CONFIG_SPI_FRAM_RAMTRON_NON_JEDEC
372 @@ -259,11 +247,11 @@ struct spi_flash *spi_fram_probe_ramtron
374 ret = spi_flash_cmd(spi, CMD_READ_STATUS, &sr, 1);
379 /* Bits 5,4,0 are fixed 0 for all devices */
380 if ((sr & 0x31) != 0x00)
383 /* now find the device */
384 for (i = 0; i < ARRAY_SIZE(ramtron_spi_fram_table); i++) {
385 params = &ramtron_spi_fram_table[i];
386 @@ -281,23 +269,16 @@ struct spi_flash *spi_fram_probe_ramtron
387 /* arriving here means no method has found a device we can handle */
388 debug("SF/ramtron: unsupported device id0=%02x id1=%02x id2=%02x\n",
389 idcode[0], idcode[1], idcode[2]);
394 - sn = malloc(sizeof(*sn));
396 - debug("SF: Failed to allocate memory\n");
399 + flash->priv = (void *)params;
400 + flash->name = params->name;
402 - sn->params = params;
403 - sn->flash.spi = spi;
404 - sn->flash.name = params->name;
406 - sn->flash.write = ramtron_write;
407 - sn->flash.read = ramtron_read;
408 - sn->flash.erase = ramtron_erase;
409 - sn->flash.size = params->size;
410 + flash->write = ramtron_write;
411 + flash->read = ramtron_read;
412 + flash->erase = ramtron_erase;
413 + flash->size = params->size;
418 --- a/drivers/mtd/spi/spansion.c
419 +++ b/drivers/mtd/spi/spansion.c
420 @@ -105,10 +105,9 @@ static const struct spansion_spi_flash_p
424 -struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
425 +int spi_flash_probe_spansion(struct spi_flash *flash, u8 *idcode)
427 const struct spansion_spi_flash_params *params;
428 - struct spi_flash *flash;
430 unsigned short jedec, ext_jedec;
432 @@ -125,16 +124,10 @@ struct spi_flash *spi_flash_probe_spansi
434 if (i == ARRAY_SIZE(spansion_spi_flash_table)) {
435 debug("SF: Unsupported SPANSION ID %04x %04x\n", jedec, ext_jedec);
440 - flash = malloc(sizeof(*flash));
442 - debug("SF: Failed to allocate memory\n");
447 + flash->priv = (void *)params;
448 flash->name = params->name;
450 flash->write = spi_flash_cmd_write_multi;
451 @@ -144,5 +137,5 @@ struct spi_flash *spi_flash_probe_spansi
452 flash->sector_size = 256 * params->pages_per_sector;
453 flash->size = flash->sector_size * params->nr_sectors;
458 --- a/drivers/mtd/spi/spi_flash.c
459 +++ b/drivers/mtd/spi/spi_flash.c
460 @@ -296,7 +296,7 @@ int spi_flash_cmd_write_status(struct sp
464 - struct spi_flash *(*probe) (struct spi_slave *spi, u8 *idcode);
465 + int (*probe) (struct spi_flash *flash, u8 *idcode);
467 /* Keep it sorted by define name */
468 #ifdef CONFIG_SPI_FLASH_ATMEL
469 @@ -343,7 +343,7 @@ struct spi_flash *spi_flash_probe(unsign
470 unsigned int max_hz, unsigned int spi_mode)
472 struct spi_slave *spi;
473 - struct spi_flash *flash = NULL;
474 + struct spi_flash *flash;
476 u8 idcode[IDCODE_LEN], *idp;
477 #ifdef CONFIG_NEEDS_MANUAL_RELOC
478 @@ -379,6 +379,15 @@ struct spi_flash *spi_flash_probe(unsign
479 print_buffer(0, idcode, 1, sizeof(idcode), 0);
482 + flash = malloc(sizeof(*flash));
484 + debug("SF: failed to alloc memory\n");
488 + memset(flash, 0, sizeof(*flash));
491 /* count the number of continuation bytes */
492 for (shift = 0, idp = idcode;
493 shift < IDCODE_CONT_LEN && *idp == 0x7f;
494 @@ -389,12 +398,12 @@ struct spi_flash *spi_flash_probe(unsign
495 for (i = 0; i < ARRAY_SIZE(flashes); ++i)
496 if (flashes[i].shift == shift && flashes[i].idcode == *idp) {
497 /* we have a match, call probe */
498 - flash = flashes[i].probe(spi, idp);
500 + ret = flashes[i].probe(flash, idp);
507 printf("SF: Unsupported manufacturer %02x\n", *idp);
508 goto err_manufacturer_probe;
510 @@ -408,6 +417,8 @@ struct spi_flash *spi_flash_probe(unsign
513 err_manufacturer_probe:
517 spi_release_bus(spi);
519 --- a/drivers/mtd/spi/spi_flash_internal.h
520 +++ b/drivers/mtd/spi/spi_flash_internal.h
521 @@ -98,11 +98,11 @@ int spi_flash_cmd_wait_ready(struct spi_
522 int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len);
524 /* Manufacturer-specific probe functions */
525 -struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode);
526 -struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode);
527 -struct spi_flash *spi_flash_probe_eon(struct spi_slave *spi, u8 *idcode);
528 -struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode);
529 -struct spi_flash *spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode);
530 -struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 *idcode);
531 -struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode);
532 -struct spi_flash *spi_fram_probe_ramtron(struct spi_slave *spi, u8 *idcode);
533 +int spi_flash_probe_spansion(struct spi_flash *flash, u8 *idcode);
534 +int spi_flash_probe_atmel(struct spi_flash *flash, u8 *idcode);
535 +int spi_flash_probe_eon(struct spi_flash *flash, u8 *idcode);
536 +int spi_flash_probe_macronix(struct spi_flash *flash, u8 *idcode);
537 +int spi_flash_probe_sst(struct spi_flash *flash, u8 *idcode);
538 +int spi_flash_probe_stmicro(struct spi_flash *flash, u8 *idcode);
539 +int spi_flash_probe_winbond(struct spi_flash *flash, u8 *idcode);
540 +int spi_fram_probe_ramtron(struct spi_flash *flash, u8 *idcode);
541 --- a/drivers/mtd/spi/sst.c
542 +++ b/drivers/mtd/spi/sst.c
543 @@ -39,11 +39,6 @@ struct sst_spi_flash_params {
547 -struct sst_spi_flash {
548 - struct spi_flash flash;
549 - const struct sst_spi_flash_params *params;
552 static const struct sst_spi_flash_params sst_spi_flash_table[] = {
555 @@ -185,11 +180,9 @@ sst_write_wp(struct spi_flash *flash, u3
560 -spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode)
561 +int spi_flash_probe_sst(struct spi_flash *flash, u8 *idcode)
563 const struct sst_spi_flash_params *params;
564 - struct sst_spi_flash *stm;
567 for (i = 0; i < ARRAY_SIZE(sst_spi_flash_table); ++i) {
568 @@ -200,31 +193,24 @@ spi_flash_probe_sst(struct spi_slave *sp
570 if (i == ARRAY_SIZE(sst_spi_flash_table)) {
571 debug("SF: Unsupported SST ID %02x\n", idcode[1]);
575 - stm = malloc(sizeof(*stm));
577 - debug("SF: Failed to allocate memory\n");
582 - stm->params = params;
583 - stm->flash.spi = spi;
584 - stm->flash.name = params->name;
585 + flash->priv = (void *)params;
586 + flash->name = params->name;
588 - if (stm->params->flags & SST_FEAT_WP)
589 - stm->flash.write = sst_write_wp;
590 + if (params->flags & SST_FEAT_WP)
591 + flash->write = sst_write_wp;
593 - stm->flash.write = spi_flash_cmd_write_multi;
594 - stm->flash.erase = spi_flash_cmd_erase;
595 - stm->flash.read = spi_flash_cmd_read_fast;
596 - stm->flash.page_size = 256;
597 - stm->flash.sector_size = 4096;
598 - stm->flash.size = stm->flash.sector_size * params->nr_sectors;
599 + flash->write = spi_flash_cmd_write_multi;
600 + flash->erase = spi_flash_cmd_erase;
601 + flash->read = spi_flash_cmd_read_fast;
602 + flash->page_size = 256;
603 + flash->sector_size = 4096;
604 + flash->size = flash->sector_size * params->nr_sectors;
606 /* Flash powers up read-only, so clear BP# bits */
607 - spi_flash_cmd_write_status(&stm->flash, 0);
608 + spi_flash_cmd_write_status(flash, 0);
610 - return &stm->flash;
613 --- a/drivers/mtd/spi/stmicro.c
614 +++ b/drivers/mtd/spi/stmicro.c
615 @@ -112,10 +112,10 @@ static const struct stmicro_spi_flash_pa
619 -struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
620 +int spi_flash_probe_stmicro(struct spi_flash *flash, u8 * idcode)
622 const struct stmicro_spi_flash_params *params;
623 - struct spi_flash *flash;
624 + struct spi_slave *spi = flash->spi;
628 @@ -123,13 +123,13 @@ struct spi_flash *spi_flash_probe_stmicr
629 i = spi_flash_cmd(spi, CMD_M25PXX_RES,
634 if ((idcode[3] & 0xf0) == 0x10) {
637 idcode[2] = idcode[3] + 1;
643 id = ((idcode[1] << 8) | idcode[2]);
644 @@ -143,16 +143,10 @@ struct spi_flash *spi_flash_probe_stmicr
646 if (i == ARRAY_SIZE(stmicro_spi_flash_table)) {
647 debug("SF: Unsupported STMicro ID %04x\n", id);
652 - flash = malloc(sizeof(*flash));
654 - debug("SF: Failed to allocate memory\n");
659 + flash->priv = (void *)params;
660 flash->name = params->name;
662 flash->write = spi_flash_cmd_write_multi;
663 @@ -162,5 +156,5 @@ struct spi_flash *spi_flash_probe_stmicr
664 flash->sector_size = 256 * params->pages_per_sector;
665 flash->size = flash->sector_size * params->nr_sectors;
670 --- a/drivers/mtd/spi/winbond.c
671 +++ b/drivers/mtd/spi/winbond.c
672 @@ -69,10 +69,9 @@ static const struct winbond_spi_flash_pa
676 -struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
677 +int spi_flash_probe_winbond(struct spi_flash *flash, u8 *idcode)
679 const struct winbond_spi_flash_params *params;
680 - struct spi_flash *flash;
683 for (i = 0; i < ARRAY_SIZE(winbond_spi_flash_table); i++) {
684 @@ -84,16 +83,10 @@ struct spi_flash *spi_flash_probe_winbon
685 if (i == ARRAY_SIZE(winbond_spi_flash_table)) {
686 debug("SF: Unsupported Winbond ID %02x%02x\n",
687 idcode[1], idcode[2]);
692 - flash = malloc(sizeof(*flash));
694 - debug("SF: Failed to allocate memory\n");
699 + flash->priv = (void *)params;
700 flash->name = params->name;
702 flash->write = spi_flash_cmd_write_multi;
703 @@ -103,5 +96,5 @@ struct spi_flash *spi_flash_probe_winbon
704 flash->sector_size = 4096;
705 flash->size = 4096 * 16 * params->nr_blocks;
710 --- a/include/spi_flash.h
711 +++ b/include/spi_flash.h
712 @@ -31,6 +31,7 @@ struct spi_flash {
713 struct spi_slave *spi;
718 /* Total flash size */