From ff7bc7d2d1a893313c56ed415150b3a2c0d0cd40 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Thu, 19 Mar 2026 16:15:28 +0100 Subject: [PATCH] drivers/amd/ftpm: Fix compilation The function tlcl2_get_capability() is only linked when Kconfig TPM2 is being selected. Add a guard to not include the SMBIOS code when TPM2 isn't selected. TEST=Can compile the fTPM driver when TPM2 isn't selected. Change-Id: I9385f15fc71c021f9be2bfb874898f76fa71fee4 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/91775 Reviewed-by: Maximilian Brune Tested-by: build bot (Jenkins) --- src/drivers/amd/ftpm/tis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/amd/ftpm/tis.c b/src/drivers/amd/ftpm/tis.c index 0f0dd5c899..49ad0bd335 100644 --- a/src/drivers/amd/ftpm/tis.c +++ b/src/drivers/amd/ftpm/tis.c @@ -111,7 +111,7 @@ static const char *crb_tpm_acpi_name(const struct device *dev) return "TPM2"; } -#if CONFIG(GENERATE_SMBIOS_TABLES) +#if CONFIG(GENERATE_SMBIOS_TABLES) && CONFIG(TPM2) static tpm_result_t tpm_get_cap(uint32_t property, uint32_t *value) { TPMS_CAPABILITY_DATA cap_data; @@ -188,7 +188,7 @@ static struct device_operations __maybe_unused amd_crb_ops = { .acpi_name = crb_tpm_acpi_name, .acpi_fill_ssdt = crb_tpm_fill_ssdt, #endif -#if CONFIG(GENERATE_SMBIOS_TABLES) +#if CONFIG(GENERATE_SMBIOS_TABLES) && CONFIG(TPM2) .get_smbios_data = smbios_write_type43_tpm, #endif };