From 0b0dfc48b47e44d547282b20f6d8c97103fadbe6 Mon Sep 17 00:00:00 2001 From: Jarkko Sakkinen Date: Thu, 10 Jun 2021 15:24:49 +0300 Subject: [PATCH] tpm_tis: Use request_locality() before calling tpm2_probe() Avoid unnecessary round-tripping in and out of the TIS driver by calling request_locality() directly, instead of going through tpm_chip_start(), and for the consistency sake (other sites in initialization code work this way). Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_tis_core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 69579efb247b..3b5a03f9efce 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -980,13 +980,11 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, intmask &= ~TPM_GLOBAL_INT_ENABLE; tpm_tis_write32(priv, TPM_INT_ENABLE(priv->locality), intmask); - rc = tpm_chip_start(chip); - if (rc) + rc = request_locality(chip, 0); + if (rc < 0) goto out_err; rc = tpm2_probe(chip); - tpm_chip_stop(chip); - if (rc) - goto out_err; + release_locality(chip, 0); rc = tpm_tis_read32(priv, TPM_DID_VID(0), &vendor); if (rc < 0) -- 2.31.1