From cbd5bb9cc755ad406e7e13572ff104af1f8b269d Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 26 Jan 2021 18:05:21 +0100 Subject: soc/amd/picasso/chip: use switch/case statement in enable_dev() The default case is only needed to make the compiler happy. Signed-off-by: Felix Held Change-Id: Idf54e7128f9e9d96f15ac7ab121f22621e033fac Reviewed-on: https://review.coreboot.org/c/coreboot/+/49941 Reviewed-by: Raul Rangel Reviewed-by: Marshall Dawson Tested-by: build bot (Jenkins) --- src/soc/amd/picasso/chip.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/soc') diff --git a/src/soc/amd/picasso/chip.c b/src/soc/amd/picasso/chip.c index d31e94a277..91dd4c4956 100644 --- a/src/soc/amd/picasso/chip.c +++ b/src/soc/amd/picasso/chip.c @@ -82,12 +82,18 @@ static void set_mmio_dev_ops(struct device *dev) 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_MMIO) { + break; + case DEVICE_PATH_MMIO: set_mmio_dev_ops(dev); + break; + default: + break; } } -- cgit v1.2.3