Skip to content

Commit 1d19155

Browse files
author
Jarkko Sakkinen
committed
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 <jarkko.sakkinen@linux.intel.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
1 parent 20f482a commit 1d19155

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

drivers/char/tpm/tpm.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,6 @@ struct tpm_chip {
195195

196196
#define to_tpm_chip(d) container_of(d, struct tpm_chip, dev)
197197

198-
static inline int tpm_read_index(int base, int index)
199-
{
200-
outb(index, base);
201-
return inb(base+1) & 0xFF;
202-
}
203-
204-
static inline void tpm_write_index(int base, int index, int value)
205-
{
206-
outb(index, base);
207-
outb(value & 0xFF, base+1);
208-
}
209198
struct tpm_input_header {
210199
__be16 tag;
211200
__be32 length;

drivers/char/tpm/tpm_atmel.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ enum tpm_atmel_addr {
9696
TPM_ATMEL_BASE_ADDR_HI = 0x09
9797
};
9898

99+
static inline int tpm_read_index(int base, int index)
100+
{
101+
outb(index, base);
102+
return inb(base+1) & 0xFF;
103+
}
104+
99105
/* Verify this is a 1.1 Atmel TPM */
100106
static int atmel_verify_tpm11(void)
101107
{

drivers/char/tpm/tpm_nsc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,18 @@ static struct platform_driver nsc_drv = {
278278
},
279279
};
280280

281+
static inline int tpm_read_index(int base, int index)
282+
{
283+
outb(index, base);
284+
return inb(base+1) & 0xFF;
285+
}
286+
287+
static inline void tpm_write_index(int base, int index, int value)
288+
{
289+
outb(index, base);
290+
outb(value & 0xFF, base+1);
291+
}
292+
281293
static int __init init_nsc(void)
282294
{
283295
int rc = 0;

0 commit comments

Comments
 (0)