summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-03-31 12:05:36 +0200
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-06-25 16:26:35 +0200
commitd30b8e4f68ef182f8dd84c76af9f148ca5842ea3 (patch)
tree9afe98d5c9fed7919bd181d19d7d0888bb741222 /drivers/char
parenttpm: fix tpm_bios_log_setup stub prototype (diff)
downloadlinux-d30b8e4f68ef182f8dd84c76af9f148ca5842ea3.tar.xz
linux-d30b8e4f68ef182f8dd84c76af9f148ca5842ea3.zip
tpm: cleanup tpm_tis_remove()
Created a local variable pointing to the INT_ENABLE_x register. The expression clearing INT_ENABLE_x.globalIntEnable is unreadable and hard to modify without surpassing the 80 char boundary. Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Christophe Ricard <christophe-h.ricard@st.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tpm/tpm_tis.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index eed3bf510682..18236f66c084 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -650,15 +650,13 @@ MODULE_PARM_DESC(interrupts, "Enable interrupts");
static void tpm_tis_remove(struct tpm_chip *chip)
{
+ void __iomem *reg = chip->vendor.iobase +
+ TPM_INT_ENABLE(chip->vendor.locality);
+
if (chip->flags & TPM_CHIP_FLAG_TPM2)
tpm2_shutdown(chip, TPM2_SU_CLEAR);
- iowrite32(~TPM_GLOBAL_INT_ENABLE &
- ioread32(chip->vendor.iobase +
- TPM_INT_ENABLE(chip->vendor.
- locality)),
- chip->vendor.iobase +
- TPM_INT_ENABLE(chip->vendor.locality));
+ iowrite32(~TPM_GLOBAL_INT_ENABLE & ioread32(reg), reg);
release_locality(chip, chip->vendor.locality, 1);
}