Attention is currently required from: Edward O'Callaghan, Angel Pons, Anastasia Klimchuk. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52774 )
Change subject: pickit2_spi.c: Refactor singleton states into reentrant pattern ......................................................................
Patch Set 2: Code-Review+1
(2 comments)
File pickit2_spi.c:
https://review.coreboot.org/c/flashrom/+/52774/comment/4b51141e_2977d293 PS1, Line 57: };
Oh I am so happy that you asked! We haven't discussed this aspect in details, which I was slightly w […]
I see what you are getting at.
Still, in theory, a struct with a single member is storage-wise the same as that member without a struct. If you'd let the framework allocate a pointer (instead of a struct with only a pointer within) it wouldn't make a difference. `data` would then be of type `libusb_device_handle **`. A pointer to a struct is nicer than that, so struct seems good!
https://review.coreboot.org/c/flashrom/+/52774/comment/2bf8b7dd_2b612051 PS1, Line 343: static struct spi_master spi_master_pickit2 = {
The per-instance `data` pointer should simply be passed to register_spi_master() […]
Ack