Add a NULL check and only skip setting the default operations if `.ops` was set by a driver. It's fairly unlikely that some- body adds a driver and forgets the `.ops` pointer. So this is mostly to increase readability: Nobody should have to wonder if we're missing a NULL-check. The condition is moved out of the loop to reduce indentation levels. Alternatively, we could jusk skip drivers that don't have `.ops` set (i.e. continue the loop). Change-Id: I5dcc05ebb092fb9c4be929c81ea2b05a10b1311b Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46297 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> |
||
|---|---|---|
| .. | ||
| dram | ||
| oprom | ||
| azalia_device.c | ||
| cardbus_device.c | ||
| cpu_device.c | ||
| device.c | ||
| device_const.c | ||
| device_util.c | ||
| hypertransport.c | ||
| i2c.c | ||
| i2c_bus.c | ||
| Kconfig | ||
| Makefile.inc | ||
| mmio.c | ||
| pci_class.c | ||
| pci_device.c | ||
| pci_early.c | ||
| pci_ops.c | ||
| pci_rom.c | ||
| pciexp_device.c | ||
| pcix_device.c | ||
| pnp_device.c | ||
| resource_allocator_common.c | ||
| resource_allocator_v3.c | ||
| resource_allocator_v4.c | ||
| root_device.c | ||
| smbus_ops.c | ||
| software_i2c.c | ||
| xhci.c | ||