summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_tis_spi_main.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2023-07-24 00:34:06 +0200
committerMark Brown <broonie@kernel.org>2023-07-24 00:34:06 +0200
commit9c214af0bd0f43df214470a35bc38dd5602b666f (patch)
treee95ac46b8fdca90a122b73eac96158985d85ef70 /drivers/char/tpm/tpm_tis_spi_main.c
parentregmap: Remove dynamic allocation warnings for rbtree and maple (diff)
parentLinux 6.5-rc3 (diff)
downloadlinux-9c214af0bd0f43df214470a35bc38dd5602b666f.tar.xz
linux-9c214af0bd0f43df214470a35bc38dd5602b666f.zip
regmap: Merge up fixes from mainline
There's several things here that will really help my CI.
Diffstat (limited to 'drivers/char/tpm/tpm_tis_spi_main.c')
-rw-r--r--drivers/char/tpm/tpm_tis_spi_main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
index 1f5207974a17..9bfaba092a06 100644
--- a/drivers/char/tpm/tpm_tis_spi_main.c
+++ b/drivers/char/tpm/tpm_tis_spi_main.c
@@ -136,6 +136,14 @@ int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u16 len,
}
exit:
+ if (ret < 0) {
+ /* Deactivate chip select */
+ memset(&spi_xfer, 0, sizeof(spi_xfer));
+ spi_message_init(&m);
+ spi_message_add_tail(&spi_xfer, &m);
+ spi_sync_locked(phy->spi_device, &m);
+ }
+
spi_bus_unlock(phy->spi_device->master);
return ret;
}