aboutsummaryrefslogtreecommitdiff
path: root/drivers/tpm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tpm')
-rw-r--r--drivers/tpm/tpm2_tis_core.c6
-rw-r--r--drivers/tpm/tpm2_tis_mmio.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/drivers/tpm/tpm2_tis_core.c b/drivers/tpm/tpm2_tis_core.c
index ec8c730fe90..51392c45849 100644
--- a/drivers/tpm/tpm2_tis_core.c
+++ b/drivers/tpm/tpm2_tis_core.c
@@ -378,8 +378,14 @@ out:
int tpm_tis_cleanup(struct udevice *dev)
{
struct tpm_chip *chip = dev_get_priv(dev);
+ int ret;
+
+ ret = tpm_tis_request_locality(dev, 0);
+ if (ret)
+ return ret;
tpm_tis_ready(dev);
+
tpm_tis_release_locality(dev, chip->locality);
return 0;
diff --git a/drivers/tpm/tpm2_tis_mmio.c b/drivers/tpm/tpm2_tis_mmio.c
index 9cedff22250..a646ce41ff4 100644
--- a/drivers/tpm/tpm2_tis_mmio.c
+++ b/drivers/tpm/tpm2_tis_mmio.c
@@ -118,10 +118,13 @@ iounmap:
static int tpm_tis_remove(struct udevice *dev)
{
struct tpm_tis_chip_data *drv_data = (void *)dev_get_driver_data(dev);
+ int ret;
+
+ ret = tpm_tis_cleanup(dev);
iounmap(drv_data->iobase);
- return tpm_tis_cleanup(dev);
+ return ret;
}
static const struct tpm_ops tpm_tis_ops = {