From e0dd03caf20d040a0a86b6bd74028ec9bda545f5 Mon Sep 17 00:00:00 2001 From: Kylene Jo Hall Date: Sat, 22 Apr 2006 02:37:26 -0700 Subject: [PATCH] tpm: return chip from tpm_register_hardware Changes in the 1.2 TPM Specification make it necessary to update some fields of the chip structure in the initialization function after it is registered with tpm.c thus tpm_register_hardware was modified to return a pointer to the structure. This patch makes that change and the associated changes in tpm_atmel and tpm_nsc. The changes to tpm_infineon will be coming in a patch from Marcel Selhorst. Signed-off-by: Kylene Hall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/tpm/tpm_atmel.h | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'drivers/char/tpm/tpm_atmel.h') diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h index d3478aaadd7..2e68eeb8a2c 100644 --- a/drivers/char/tpm/tpm_atmel.h +++ b/drivers/char/tpm/tpm_atmel.h @@ -28,13 +28,12 @@ #define atmel_request_region request_mem_region #define atmel_release_region release_mem_region -static inline void atmel_put_base_addr(struct tpm_vendor_specific - *vendor) +static inline void atmel_put_base_addr(void __iomem *iobase) { - iounmap(vendor->iobase); + iounmap(iobase); } -static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific *vendor) +static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size) { struct device_node *dn; unsigned long address, size; @@ -71,9 +70,9 @@ static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific *vendor) else size = reg[naddrc]; - vendor->base = address; - vendor->region_size = size; - return ioremap(vendor->base, vendor->region_size); + *base = address; + *region_size = size; + return ioremap(*base, *region_size); } #else #define atmel_getb(chip, offset) inb(chip->vendor->base + offset) @@ -106,14 +105,12 @@ static int atmel_verify_tpm11(void) return 0; } -static inline void atmel_put_base_addr(struct tpm_vendor_specific - *vendor) +static inline void atmel_put_base_addr(void __iomem *iobase) { } /* Determine where to talk to device */ -static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific - *vendor) +static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size) { int lo, hi; @@ -123,9 +120,9 @@ static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO); hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI); - vendor->base = (hi << 8) | lo; - vendor->region_size = 2; + *base = (hi << 8) | lo; + *region_size = 2; - return ioport_map(vendor->base, vendor->region_size); + return ioport_map(*base, *region_size); } #endif -- cgit