Attention is currently required from: Edward O'Callaghan, Alexander Goncharov.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72408 )
Change subject: dummyflasher: use new API to register shutdown function ......................................................................
Patch Set 2:
(1 comment)
File dummyflasher.c:
https://review.coreboot.org/c/flashrom/+/72408/comment/96df9a22_2e108c33 PS2, Line 1416: data->refs_cnt += ((dummy_buses_supported & BUS_PROG) != BUS_NONE); : data->refs_cnt += ((dummy_buses_supported & BUS_NONSPI) != BUS_NONE); : data->refs_cnt += ((dummy_buses_supported & BUS_SPI) != BUS_NONE); : : #if 0 : data->refs_cnt += (dummy_buses_supported & BUS_PROG) ? 1 : 0; : data->refs_cnt += (dummy_buses_supported & BUS_NONSPI) ? 1 : 0; : data->refs_cnt += (dummy_buses_supported & BUS_SPI) ? 1 : 0; : #endif
I thought about it at first sight. But this approach may potentially cause flashrom to crash. […]
Okay, I understand, thanks for explanation! The main thing I take from this is: if any one register_master fails, init fails. But the code at the moment is trying to register all masters anyway. Even though just one failure makes init fail.
I still want to use the same conditions. Technically, refs_cnt should increase for every successful register master. So an amendment to my initial idea: add
if (!ret) refs_cnt++;
into every if below ?