Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/48662 )
Change subject: realtek_mst_i2c_spi.c: Add ISP mode check ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/flashrom/+/48662/1/realtek_mst_i2c_spi.c File realtek_mst_i2c_spi.c:
https://review.coreboot.org/c/flashrom/+/48662/1/realtek_mst_i2c_spi.c@163 PS1, Line 163: if (realtek_mst_i2c_spi_in_isp_mode(fd) == 0) { : msg_perr("%s: MST not in ISP mode, reset will not happen.\n", __func__); : return SPI_GENERIC_ERROR; : } just inline this,
``` uint8_t mcu_mode_val; int ret = realtek_mst_i2c_spi_read_register(fd, MCU_MODE, &mcu_mode_val); if (ret || (mcu_mode_val & MCU_ISP_MODE_MASK) == 0) { msg_perr("%s: MST not in ISP mode, cannot perform MCU reset.\n", __func__); return SPI_GENERIC_ERROR; } ```
just as an aside for future reference; A return value of >0 usually indicates some success with value, =0 is success without value and <0 indicates failure. It's a bit unconventional to use =0 to mean error as is the case with `realtek_mst_i2c_spi_in_isp_mode()`.