tpm-interface.c (1e3b73a95793555860512008035f6822406a2a79) | tpm-interface.c (01ad1fa75dd243909d62dba25a93254b20d5fe81) |
---|---|
1/* 2 * Copyright (C) 2004 IBM Corporation 3 * 4 * Authors: 5 * Leendert van Doorn <leendert@watson.ibm.com> 6 * Dave Safford <safford@watson.ibm.com> 7 * Reiner Sailer <sailer@watson.ibm.com> 8 * Kylene Hall <kjhall@us.ibm.com> --- 1046 unchanged lines hidden (view full) --- 1055/* 1056 * Called from tpm_<specific>.c probe function only for devices 1057 * the driver has determined it should claim. Prior to calling 1058 * this function the specific probe function has called pci_enable_device 1059 * upon errant exit from this function specific probe function should call 1060 * pci_disable_device 1061 */ 1062struct tpm_chip *tpm_register_hardware(struct device *dev, | 1/* 2 * Copyright (C) 2004 IBM Corporation 3 * 4 * Authors: 5 * Leendert van Doorn <leendert@watson.ibm.com> 6 * Dave Safford <safford@watson.ibm.com> 7 * Reiner Sailer <sailer@watson.ibm.com> 8 * Kylene Hall <kjhall@us.ibm.com> --- 1046 unchanged lines hidden (view full) --- 1055/* 1056 * Called from tpm_<specific>.c probe function only for devices 1057 * the driver has determined it should claim. Prior to calling 1058 * this function the specific probe function has called pci_enable_device 1059 * upon errant exit from this function specific probe function should call 1060 * pci_disable_device 1061 */ 1062struct tpm_chip *tpm_register_hardware(struct device *dev, |
1063 const struct tpm_vendor_specific *entry) | 1063 const struct tpm_class_ops *ops) |
1064{ 1065 struct tpm_chip *chip; 1066 1067 /* Driver specific per-device data */ 1068 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1069 1070 if (chip == NULL) 1071 return NULL; 1072 1073 mutex_init(&chip->tpm_mutex); 1074 INIT_LIST_HEAD(&chip->list); 1075 | 1064{ 1065 struct tpm_chip *chip; 1066 1067 /* Driver specific per-device data */ 1068 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1069 1070 if (chip == NULL) 1071 return NULL; 1072 1073 mutex_init(&chip->tpm_mutex); 1074 INIT_LIST_HEAD(&chip->list); 1075 |
1076 memcpy(&chip->vendor, entry, sizeof(struct tpm_vendor_specific)); | 1076 chip->vendor.req_complete_mask = ops->req_complete_mask; 1077 chip->vendor.req_complete_val = ops->req_complete_val; 1078 chip->vendor.req_canceled = ops->req_canceled; 1079 chip->vendor.recv = ops->recv; 1080 chip->vendor.send = ops->send; 1081 chip->vendor.cancel = ops->cancel; 1082 chip->vendor.status = ops->status; |
1077 1078 chip->dev_num = find_first_zero_bit(dev_mask, TPM_NUM_DEVICES); 1079 1080 if (chip->dev_num >= TPM_NUM_DEVICES) { 1081 dev_err(dev, "No available tpm device numbers\n"); 1082 goto out_free; 1083 } 1084 --- 42 unchanged lines hidden --- | 1083 1084 chip->dev_num = find_first_zero_bit(dev_mask, TPM_NUM_DEVICES); 1085 1086 if (chip->dev_num >= TPM_NUM_DEVICES) { 1087 dev_err(dev, "No available tpm device numbers\n"); 1088 goto out_free; 1089 } 1090 --- 42 unchanged lines hidden --- |