diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2021-02-09 16:46:14 +0100 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2021-02-10 21:50:36 +0000 |
commit | 237bc2efaa2e31378dee11fcbd1e0b0e26064573 (patch) | |
tree | c02b05bc268befd70f349b8c0fe1bfb75ad84e36 | |
parent | 72616b3813382d8eeaaf97d86ebc90e784c5bad5 (diff) |
soc/amd/stoneyridge/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
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50436
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/soc/amd/stoneyridge/chip.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/soc/amd/stoneyridge/chip.c b/src/soc/amd/stoneyridge/chip.c index 91b04c5c2c..9cae98b9db 100644 --- a/src/soc/amd/stoneyridge/chip.c +++ b/src/soc/amd/stoneyridge/chip.c @@ -105,15 +105,23 @@ static struct device_operations pci_domain_ops = { 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) |