Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/50436 )
Change subject: soc/amd/stineyridge/chip: rewrite enable_dev as switch case statement ......................................................................
soc/amd/stineyridge/chip: rewrite enable_dev as switch case statement
This also aligns Stoneyridge with Picasso and Cezanne.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I35bf9915e3502c22e9dd9efa80b00a1ce70f187d --- M src/soc/amd/stoneyridge/chip.c 1 file changed, 12 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/50436/1
diff --git a/src/soc/amd/stoneyridge/chip.c b/src/soc/amd/stoneyridge/chip.c index 91b04c5..9cae98b 100644 --- a/src/soc/amd/stoneyridge/chip.c +++ b/src/soc/amd/stoneyridge/chip.c @@ -105,15 +105,23 @@ static void enable_dev(struct device *dev) { /* Set the operations if it is a special bus type */ - if (dev->path.type == DEVICE_PATH_DOMAIN) + switch (dev->path.type) { + case DEVICE_PATH_DOMAIN: dev->ops = &pci_domain_ops; - else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) + break; + case DEVICE_PATH_CPU_CLUSTER: dev->ops = &cpu_bus_ops; - else if (dev->path.type == DEVICE_PATH_PCI) + break; + case DEVICE_PATH_PCI: sb_enable(dev); - else if (dev->path.type == DEVICE_PATH_MMIO) + break; + case DEVICE_PATH_MMIO: if (i2c_acpi_name(dev) != NULL) dev->ops = &stoneyridge_i2c_mmio_ops; + break; + default: + break; + } }
static void soc_init(void *chip_info)