Felix Singer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48293 )
Change subject: mb/prodrive/hermes: Wrap UART driver by PCI device ......................................................................
Patch Set 4:
I don't understand why this is necessary at all. Looks like you found a bug in sconfig you are trying to work around.
I don't know if it is a bug actually or if this is just not meant to be. When we started adding the chipset devicetrees for soc/skylake and soc/cannonlake, we encountered that problem on cannonlake.
If the PCI device on mb/hermes is wrapped by the UART driver and if also the patch for the chipset devicetree is applied, then the PCI device has two declarations in static.c.
DEVTREE_CONST struct device *DEVTREE_CONST __pci_0_19_2 = &_dev32; ... DEVTREE_CONST struct device *DEVTREE_CONST __pci_0_19_2 = &_dev70;
There was a similar problem with drivers/wifi/generic (CB:46865) as Michael mentioned. Furquan solved that by turning it around. So he moved the driver into the device. Here in this case, only the declaration for &_dev32 (from the example above) is left then, while &_dev72 is declared as a sub device.