Subject: [PATCH -next] tpm: fix header for modular build

From: Randy Dunlap <[email-masked]>
Date: Wed, 28 Oct 2009 10:49:26 -0700

From: Randy Dunlap <[email-masked]>

Fix build for TCG_TPM=m.  Header file doesn't handle this
and incorrectly builds stubs.

drivers/char/tpm/tpm.c:720: error: redefinition of 'tpm_pcr_read'
include/linux/tpm.h:35: error:previous definition of 'tpm_pcr_read' was here
drivers/char/tpm/tpm.c:752: error: redefinition of 'tpm_pcr_extend'
include/linux/tpm.h:38: error:previous definition of 'tpm_pcr_extend' was here

Signed-off-by: Randy Dunlap <[email-masked]>
---
 include/linux/tpm.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20091028.orig/include/linux/tpm.h
+++ linux-next-20091028/include/linux/tpm.h
@@ -27,7 +27,7 @@
  */
 #define	TPM_ANY_NUM 0xFFFF
 
-#if defined(CONFIG_TCG_TPM)
+#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
 
 extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf);
 extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash);