[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 <kjhall@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committato da
Linus Torvalds

parent
90dda520c1
commit
e0dd03caf2
@@ -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
|
||||
|
Fai riferimento in un nuovo problema
Block a user