Skip to contentSkip to conversation

tpm: TCG_ATMEL should depend on HAS_IOPORT

PATCH In review Geert Uytterhoeven 2 participants 3 messages Aug 8, 2011 – Aug 29, 2011 TPM device driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: TCG_ATMEL should depend on HAS_IOPORT

On m68k, I get:

drivers/char/tpm/tpm_atmel.h: In function ‘atmel_get_base_addr’:
drivers/char/tpm/tpm_atmel.h:129: error: implicit declaration of function ‘ioport_map’ drivers/char/tpm/tpm_atmel.h:129: warning: return makes pointer from integer without a cast

The code in tpm_atmel.h supports PPC64 (using the device tree and ioremap()) and "anything else" (using ioport_map()). However, ioportmap() is only available on platforms that set HAS_IOPORT.

Although PC64 seems to have HAS_IOPORT, a "depends on HAS_IOPORT" should work, but I think it's better to expose the special PPC64 handling explicit using "depends on PPC64 || HAS_IOPORT".

---
 drivers/char/tpm/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/char/tpm/Kconfig +1 -0
index f6595ab..fa567f1 100644
@@ -43,6 +43,7 @@ config TCG_NSC
 
 config TCG_ATMEL
 	tristate "Atmel TPM Interface"
+	depends on PPC64 || HAS_IOPORT
 	---help---
 	  If you have a TPM security chip from Atmel say Yes and it 
 	  will be accessible from within Linux.  To compile this driver 
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 11 lines · Geert Uytterhoeven

On m68k, I get:

drivers/char/tpm/tpm_atmel.h: In function ‘atmel_get_base_addr’:
drivers/char/tpm/tpm_atmel.h:129: error: implicit declaration of function ‘ioport_map’ drivers/char/tpm/tpm_atmel.h:129: warning: return makes pointer from integer without a cast

The code in tpm_atmel.h supports PPC64 (using the device tree and ioremap()) and "anything else" (using ioport_map()). However, ioportmap() is only available on platforms that set HAS_IOPORT.

Although PC64 seems to have HAS_IOPORT, a "depends on HAS_IOPORT" should work,

Since ...

Quoted 1 line

but I think it's better to expose the special PPC64 handling explicit using

... explicitly ...

Quoted 13 lines

"depends on PPC64 || HAS_IOPORT".

---
 drivers/char/tpm/Kconfig |    1 +

 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/char/tpm/Kconfig +0 -0
index f6595ab..fa567f1 100644
@@ -43,6 +43,7 @@ config TCG_NSC
 
Quoted 8 lines

 config TCG_ATMEL
       tristate "Atmel TPM Interface"
+       depends on PPC64 || HAS_IOPORT
       ---help---
         If you have a TPM security chip from Atmel say Yes and it will be accessible from within Linux.  To compile this driver --
1.7.0.4

Ping? M68k allmodconfig breakage in 3.1-rc*.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds

Acked-by on v1 1/1
#2 lore raw
In reply to Geert Uytterhoeven
Quoted 8 lines · Geert Uytterhoeven

drivers/char/tpm/tpm_atmel.h: In function ‘atmel_get_base_addr’:
drivers/char/tpm/tpm_atmel.h:129: error: implicit declaration of function ‘ioport_map’ drivers/char/tpm/tpm_atmel.h:129: warning: return makes pointer from integer without a cast

The code in tpm_atmel.h supports PPC64 (using the device tree and ioremap()) and "anything else" (using ioport_map()). However, ioportmap() is only available on platforms that set HAS_IOPORT.

Quoted 5 lines

Although PC64 seems to have HAS_IOPORT, a "depends on HAS_IOPORT" should work, but I think it's better to expose the special PPC64 handling explicit using "depends on PPC64 || HAS_IOPORT".

FWIW, I've now got a first prototype of the HAS_IOPORT rework in
http://git.kernel.org/?p=linux/kernel/git/arm/linux-arm-soc.git;a=shortlog;h=refs/heads/tmp/randconfig3
along with a lot of bug fixes for ARM. Feel free to play with that on other architectures.

Since your patch adds another use of HAS_IOPORT, I will have to rename that as well to HAS_IOPORT_MAP as I do for all the other uses.

Arnd