TPM: fix build with tpm disabled
authorJuan Quintela <quintela@redhat.com>
Tue, 2 Jun 2015 13:47:20 +0000 (15:47 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 3 Jun 2015 16:19:15 +0000 (18:19 +0200)
Failure was included on commit

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
include/sysemu/tpm.h

index c1438907de25741055195f17fb76d9cb828e0cb4..c8afa179e528232e216fccc31e9df5936dded280 100644 (file)
@@ -32,11 +32,13 @@ TPMVersion tpm_tis_get_tpm_version(Object *obj);
 
 static inline TPMVersion tpm_get_version(void)
 {
+#ifdef CONFIG_TPM
     Object *obj = object_resolve_path_type("", TYPE_TPM_TIS, NULL);
 
     if (obj) {
         return tpm_tis_get_tpm_version(obj);
     }
+#endif
     return TPM_VERSION_UNSPEC;
 }