[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>
Esse commit está contido em:
@@ -544,7 +544,8 @@ EXPORT_SYMBOL_GPL(tpm_pm_resume);
|
||||
* upon errant exit from this function specific probe function should call
|
||||
* pci_disable_device
|
||||
*/
|
||||
int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry)
|
||||
struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vendor_specific
|
||||
*entry)
|
||||
{
|
||||
#define DEVNAME_SIZE 7
|
||||
|
||||
@@ -555,7 +556,7 @@ int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry)
|
||||
/* Driver specific per-device data */
|
||||
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
|
||||
if (chip == NULL)
|
||||
return -ENOMEM;
|
||||
return NULL;
|
||||
|
||||
init_MUTEX(&chip->buffer_mutex);
|
||||
init_MUTEX(&chip->tpm_mutex);
|
||||
@@ -584,7 +585,7 @@ dev_num_search_complete:
|
||||
if (chip->dev_num < 0) {
|
||||
dev_err(dev, "No available tpm device numbers\n");
|
||||
kfree(chip);
|
||||
return -ENODEV;
|
||||
return NULL;
|
||||
} else if (chip->dev_num == 0)
|
||||
chip->vendor.miscdev.minor = TPM_MINOR;
|
||||
else
|
||||
@@ -605,7 +606,7 @@ dev_num_search_complete:
|
||||
put_device(dev);
|
||||
kfree(chip);
|
||||
dev_mask[i] &= !(1 << j);
|
||||
return -ENODEV;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
spin_lock(&driver_lock);
|
||||
@@ -620,7 +621,7 @@ dev_num_search_complete:
|
||||
|
||||
chip->bios_dir = tpm_bios_log_setup(devname);
|
||||
|
||||
return 0;
|
||||
return chip;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(tpm_register_hardware);
|
||||
|
||||
|
Referência em uma nova issue
Block a user