tpm: use tpm_transmit_cmd() in tpm2_probe()
It is better to tpm_transmit_cmd() in tpm2_probe() in order to get consistent command handling throughout the subsystem. Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
This commit is contained in:
parent
eb5854e764
commit
ae7e190a3e
|
@ -941,11 +941,9 @@ int tpm2_probe(struct tpm_chip *chip)
|
||||||
cmd.params.get_tpm_pt_in.property_id = cpu_to_be32(0x100);
|
cmd.params.get_tpm_pt_in.property_id = cpu_to_be32(0x100);
|
||||||
cmd.params.get_tpm_pt_in.property_cnt = cpu_to_be32(1);
|
cmd.params.get_tpm_pt_in.property_cnt = cpu_to_be32(1);
|
||||||
|
|
||||||
rc = tpm_transmit(chip, (const u8 *)&cmd, sizeof(cmd), 0);
|
rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), 0, NULL);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return rc;
|
return rc;
|
||||||
else if (rc < TPM_HEADER_SIZE)
|
|
||||||
return -EFAULT;
|
|
||||||
|
|
||||||
if (be16_to_cpu(cmd.header.out.tag) == TPM2_ST_NO_SESSIONS)
|
if (be16_to_cpu(cmd.header.out.tag) == TPM2_ST_NO_SESSIONS)
|
||||||
chip->flags |= TPM_CHIP_FLAG_TPM2;
|
chip->flags |= TPM_CHIP_FLAG_TPM2;
|
||||||
|
|
Loading…
Reference in a new issue