From 04c49a5e7cd92feb761d0d861472f12ccf6fc23b Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 22 Aug 2023 13:16:40 +0200 Subject: drivers/pc80/tpm: Silence warnings when CONFIG_TPM is unset Add some noop device_operations for devices below chip drivers/pc80/tpm in the case CONFIG_TPM is unset. This avoids the warning "... missing read_resources" when probing all devices for resources. Signed-off-by: Arthur Heymans Change-Id: Ibc37642a8b5f37b95c648141e03025a04ffa36bc Reviewed-on: https://review.coreboot.org/c/coreboot/+/77386 Reviewed-by: Eric Lai Tested-by: build bot (Jenkins) --- src/drivers/pc80/tpm/tis.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/drivers') diff --git a/src/drivers/pc80/tpm/tis.c b/src/drivers/pc80/tpm/tis.c index ed9c8d0e0b..1ae6f1dc92 100644 --- a/src/drivers/pc80/tpm/tis.c +++ b/src/drivers/pc80/tpm/tis.c @@ -832,6 +832,11 @@ static struct device_operations lpc_tpm_ops = { #endif }; +static struct device_operations noop_tpm_ops = { + .read_resources = noop_read_resources, + .set_resources = noop_set_resources, +}; + static struct pnp_info pnp_dev_info[] = { { .flags = PNP_IRQ0 } }; @@ -841,6 +846,8 @@ static void enable_dev(struct device *dev) if (CONFIG(TPM)) pnp_enable_devices(dev, &lpc_tpm_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); + else + pnp_enable_devices(dev, &noop_tpm_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); } struct chip_operations drivers_pc80_tpm_ops = { -- cgit v1.2.3