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>
This commit is contained in:
Felix Held 2021-02-09 16:46:14 +01:00 committed by Martin Roth
parent 72616b3813
commit 237bc2efaa
1 changed files with 12 additions and 4 deletions

View File

@ -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)