Attention is currently required from: Thomas Heijligen.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73570 )
Change subject: pcidev: remove pcidev_getdevfn() function ......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
oh sorry :( what do we do now?
PCI access in flashrom is a big mess. Possibly the structure to handle the issues is to have a struct full of pci worker func pointers containing an opaque state machine with the pacc handle inside initialised at `struct bus_cfg` initiation time then passed down into either board_cfg || programmer_cfg or maybe just itself. It is hard to think so many moves ahead as other pre-requirements need to land first like the board_cfg cleanup series.
So that could look something akin to; ``` struct flashrom_pcihandle { struct pci_access *pacc; }; struct flashrom_pcibus { struct flashrom_pci handle; int (*find)(..); int (*scan)(..); int (*read)(..); int (*write)(..); }; ``` I don't really like the OOP'ism however the tree has deeply ingrained excessive encapsulation patterns gone rampant and so any procedural state management winds up tripping you up on edge cases.
In either case, I would say this commit could be reverted as it seems to be motivated by aesthetic but not fixing a actually issue. The author just didn't notice the `pacc` singleton state machine containment as there was one patch missing that made it truly static. The reason being is that patch got stalled out unfortunately.