When the TPM is disabled, avoid trying to use it in the app.

Signed-off-by: Simon Glass <[email protected]>
---

 lib/efi_client/efi_app_init.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/efi_client/efi_app_init.c b/lib/efi_client/efi_app_init.c
index ff31266fb12..938b16d14ab 100644
--- a/lib/efi_client/efi_app_init.c
+++ b/lib/efi_client/efi_app_init.c
@@ -347,9 +347,11 @@ int board_early_init_r(void)
                        if (ret)
                                return ret;
                }
-               ret = setup_tpm();
-               if (ret)
-                       return ret;
+               if (IS_ENABLED(CONFIG_TPM)) {
+                       ret = setup_tpm();
+                       if (ret)
+                               return ret;
+               }
        }
 
        return 0;
-- 
2.43.0

Reply via email to