Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/47655 )
Change subject: it85spi.c: Refactor singleton states into reentrant pattern ......................................................................
Patch Set 2:
(7 comments)
https://review.coreboot.org/c/flashrom/+/47655/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/flashrom/+/47655/1//COMMIT_MSG@7 PS1, Line 7: Factor out global state
Refactor singleton states into reentrant pattern
Done
https://review.coreboot.org/c/flashrom/+/47655/1//COMMIT_MSG@9 PS1, Line 9: Moves global state into spi_master data.
Move global singleton states into a struct and store within the spi_master data field for the life-t […]
Done
https://review.coreboot.org/c/flashrom/+/47655/1//COMMIT_MSG@11 PS1, Line 11: BUGS
BUG=b:172876667 […]
Done
https://review.coreboot.org/c/flashrom/+/47655/1/it85spi.c File it85spi.c:
https://review.coreboot.org/c/flashrom/+/47655/1/it85spi.c@87 PS1, Line 87: static struct spi_master spi_master_it85xx = { : .max_data_read = 64, : .max_data_write = 64, : .command = it85xx_spi_send_command, : .multicommand = default_spi_send_multicommand, : .read = default_spi_read, : .write_256 = default_spi_write_256, : .write_aai = default_spi_write_aai, : };
actually this shouldn't move
I moved it as we discussed, it is now in the middle (no need to be on the very top).
https://review.coreboot.org/c/flashrom/+/47655/1/it85spi.c@235 PS1, Line 235: struct it85_data *drv_data = (struct it85_data *)data;
calling it85xx_exit_scratch_rom(data) should auto cast the void * so no need for this line.
Done
https://review.coreboot.org/c/flashrom/+/47655/1/it85spi.c@235 PS1, Line 235: struct it85_data *drv_data = (struct it85_data *)data;
calling it85xx_exit_scratch_rom(data) should auto cast the void * so no need for this line.
Done
https://review.coreboot.org/c/flashrom/+/47655/1/it85spi.c@343 PS1, Line 343: if (!(flash->mst)) { : msg_perr("No data in flash context!\n"); : return 1; : }
you do not need this validation as it occurs already in the core. […]
I wrote get_data_from_context taking it87spi.c as an inspiration.