1 comment:
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()`.
To view, visit change 48662. To unsubscribe, or for help writing mail filters, visit settings.