From 2f257402ee981720d65080b1e3ce19f693f5c9c3 Mon Sep 17 00:00:00 2001 From: Jarkko Sakkinen Date: Sun, 4 Nov 2018 20:01:42 +0200 Subject: tpm: remove TPM_TRANSMIT_UNLOCKED flag Added locking as part of tpm_try_get_ops() and tpm_put_ops() as they are anyway used in most of the call sites except in tpmrm_release() where we take the locks manually. Signed-off-by: Jarkko Sakkinen Reviewed-by: Stefan Berger Tested-by: Stefan Berger Reviewed-by: Jerry Snitselaar Reviewed-by: James Bottomley Tested-by: Alexander Steffen --- drivers/char/tpm/tpm-interface.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'drivers/char/tpm/tpm-interface.c') diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c index 5acbef8cf2ce..54a15f59e175 100644 --- a/drivers/char/tpm/tpm-interface.c +++ b/drivers/char/tpm/tpm-interface.c @@ -236,10 +236,6 @@ ssize_t tpm_transmit(struct tpm_chip *chip, u8 *buf, size_t bufsiz, memcpy(save, buf, save_size); for (;;) { - if (!(flags & TPM_TRANSMIT_UNLOCKED) && - !(flags & TPM_TRANSMIT_NESTED)) - mutex_lock(&chip->tpm_mutex); - if (chip->ops->clk_enable != NULL) chip->ops->clk_enable(chip, true); @@ -266,10 +262,6 @@ out_locality: if (chip->ops->clk_enable != NULL) chip->ops->clk_enable(chip, false); - if (!(flags & TPM_TRANSMIT_UNLOCKED) && - !(flags & TPM_TRANSMIT_NESTED)) - mutex_unlock(&chip->tpm_mutex); - if (ret < 0) break; rc = be32_to_cpu(header->return_code); -- cgit v1.2.3