summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2023-08-22 13:16:40 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-09-15 13:46:46 +0000
commit04c49a5e7cd92feb761d0d861472f12ccf6fc23b (patch)
tree8ed4bc8c1c703f5cdc6e9d74143a7cb46abe6e5e /src/drivers
parent77d8e0bec69f67e2eea84aeeee64abe7b470ef71 (diff)
downloadcoreboot-04c49a5e7cd92feb761d0d861472f12ccf6fc23b.tar.gz
coreboot-04c49a5e7cd92feb761d0d861472f12ccf6fc23b.tar.bz2
coreboot-04c49a5e7cd92feb761d0d861472f12ccf6fc23b.zip
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 <arthur@aheymans.xyz> Change-Id: Ibc37642a8b5f37b95c648141e03025a04ffa36bc Reviewed-on: https://review.coreboot.org/c/coreboot/+/77386 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/pc80/tpm/tis.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/drivers/pc80/tpm/tis.c b/src/drivers/pc80/tpm/tis.c
index ed9c8d0e0bde..1ae6f1dc92ba 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 = {