On Fri, 2017-07-14 at 17:03 +0000, Gabriele Paoloni wrote: > > I'd rather we have no default device until a driver actually picks up > > though, and then, if we still have no default, use the first driver to > > pick up. > > Well from my understanding the PCI host controller driver will enumerate > all the devices in the PCI hierarchy and call pci_device_add() for each of > them, that in turn will call device_add(), at this stage if there is a > driver available for the device such driver will probe otherwise it will not. > > Are you suggesting to add the code above in pci_device_add() after device_add() > and after checking that a driver has been bound for such dev? I don't like us turning on MEM/IO decoding on a device that has potentially not been initialized by its driver. Ben.