diff --git a/src/soc/intel/pantherlake/chip.c b/src/soc/intel/pantherlake/chip.c index 24c6fc33ee..8005240475 100644 --- a/src/soc/intel/pantherlake/chip.c +++ b/src/soc/intel/pantherlake/chip.c @@ -247,6 +247,9 @@ static struct device_operations cpu_bus_ops = { static void soc_enable(struct device *dev) { + struct device_operations *soc_p2sb_ops = (struct device_operations *)&p2sb_ops; + struct device_operations *soc_p2sb2_ops = (struct device_operations *)&p2sb2_ops; + /* * Set the operations if it is a special bus type or a hidden PCI * device. @@ -260,10 +263,10 @@ static void soc_enable(struct device *dev) dev->ops = &pmc_ops; else if (dev->path.type == DEVICE_PATH_PCI && dev->path.pci.devfn == PCI_DEVFN_P2SB) - dev->ops = &pcd_p2sb_ops; + dev->ops = soc_p2sb_ops; else if (dev->path.type == DEVICE_PATH_PCI && dev->path.pci.devfn == PCI_DEVFN_P2SB2) - dev->ops = &pcd_p2sb_2_ops; + dev->ops = soc_p2sb2_ops; else if (dev->path.type == DEVICE_PATH_GPIO) block_gpio_enable(dev); } diff --git a/src/soc/intel/pantherlake/include/soc/p2sb.h b/src/soc/intel/pantherlake/include/soc/p2sb.h index 9bf7e2d4b8..36ffd2957b 100644 --- a/src/soc/intel/pantherlake/include/soc/p2sb.h +++ b/src/soc/intel/pantherlake/include/soc/p2sb.h @@ -8,7 +8,7 @@ #define PCH_P2SB_EPMASK0 0x220 -extern struct device_operations pcd_p2sb_ops; -extern struct device_operations pcd_p2sb_2_ops; +extern const struct device_operations p2sb_ops; +extern const struct device_operations p2sb2_ops; #endif diff --git a/src/soc/intel/pantherlake/p2sb.c b/src/soc/intel/pantherlake/p2sb.c index 6915463937..3b86bb07e8 100644 --- a/src/soc/intel/pantherlake/p2sb.c +++ b/src/soc/intel/pantherlake/p2sb.c @@ -1,10 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include -#include -#include #include -#include +#include void p2sb_soc_get_sb_mask(uint32_t *ep_mask, size_t count) { @@ -31,27 +29,3 @@ void p2sb_soc_get_sb_mask(uint32_t *ep_mask, size_t count) ep_mask[P2SB_EP_MASK_7_REG] = mask; } - -static void p2sb2_read_resources(struct device *dev) -{ - /* Add the fixed MMIO resource for P2SB#2 */ - mmio_range(dev, PCI_BASE_ADDRESS_0, P2SB2_BAR, P2SB2_SIZE); -} - -static void p2sb_read_resources(struct device *dev) -{ - /* Add the fixed MMIO resource for P2SB#1 */ - mmio_range(dev, PCI_BASE_ADDRESS_0, P2SB_BAR, P2SB_SIZE); -} - -struct device_operations pcd_p2sb_2_ops = { - .read_resources = p2sb2_read_resources, - .set_resources = noop_set_resources, - .scan_bus = scan_static_bus, -}; - -struct device_operations pcd_p2sb_ops = { - .read_resources = p2sb_read_resources, - .set_resources = noop_set_resources, - .scan_bus = scan_static_bus, -};