From 237bc2efaa2e31378dee11fcbd1e0b0e26064573 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 9 Feb 2021 16:46:14 +0100 Subject: soc/amd/stoneyridge/chip: rewrite enable_dev as switch case statement This also aligns Stoneyridge with Picasso and Cezanne. Signed-off-by: Felix Held Change-Id: I35bf9915e3502c22e9dd9efa80b00a1ce70f187d Reviewed-on: https://review.coreboot.org/c/coreboot/+/50436 Reviewed-by: Martin Roth Tested-by: build bot (Jenkins) --- src/soc/amd/stoneyridge/chip.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/soc/amd/stoneyridge/chip.c') 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) -- cgit v1.2.3