From: Jarkko Sakkinen Date: Wed, 25 Jan 2017 14:47:39 +0000 (+0200) Subject: tpm: remove tpm_read_index and tpm_write_index from tpm.h X-Git-Tag: v4.11-rc1~138^2~19 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1d1915532b3fb0d08aed8b2d8af1c6ea40846782;p=karo-tx-linux.git tpm: remove tpm_read_index and tpm_write_index from tpm.h These are non-generic functions and do not belong to tpm.h. Signed-off-by: Jarkko Sakkinen Reviewed-by: Jason Gunthorpe --- diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 7216bd78b643..244fcffdab6b 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h @@ -195,17 +195,6 @@ struct tpm_chip { #define to_tpm_chip(d) container_of(d, struct tpm_chip, dev) -static inline int tpm_read_index(int base, int index) -{ - outb(index, base); - return inb(base+1) & 0xFF; -} - -static inline void tpm_write_index(int base, int index, int value) -{ - outb(index, base); - outb(value & 0xFF, base+1); -} struct tpm_input_header { __be16 tag; __be32 length; diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h index 4f96d80cdce9..5c82eb47665e 100644 --- a/drivers/char/tpm/tpm_atmel.h +++ b/drivers/char/tpm/tpm_atmel.h @@ -96,6 +96,12 @@ enum tpm_atmel_addr { TPM_ATMEL_BASE_ADDR_HI = 0x09 }; +static inline int tpm_read_index(int base, int index) +{ + outb(index, base); + return inb(base+1) & 0xFF; +} + /* Verify this is a 1.1 Atmel TPM */ static int atmel_verify_tpm11(void) { diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c index 9ff0e072c476..5d6cce74cd3f 100644 --- a/drivers/char/tpm/tpm_nsc.c +++ b/drivers/char/tpm/tpm_nsc.c @@ -278,6 +278,18 @@ static struct platform_driver nsc_drv = { }, }; +static inline int tpm_read_index(int base, int index) +{ + outb(index, base); + return inb(base+1) & 0xFF; +} + +static inline void tpm_write_index(int base, int index, int value) +{ + outb(index, base); + outb(value & 0xFF, base+1); +} + static int __init init_nsc(void) { int rc = 0;