summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Reynes <philippe.reynes@softathome.com>2020-01-09 18:45:45 +0100
committerSimon Glass <sjg@chromium.org>2020-02-05 19:33:46 -0700
commitbb3f47eb78ea50bad5f1848bdac84a05116c395d (patch)
treea1c4cf49fa903ccb2c3f42ff16587ed6cddba447
parent28b417ce859490d6b06e71dbf4e842841e64d34d (diff)
downloadu-boot-bb3f47eb78ea50bad5f1848bdac84a05116c395d.tar.gz
tpm: add a helper to iterate on all tpm devices
This add a helper for_each_tpm_device that run through all the tpm (1.x and 2.0) devices. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
-rw-r--r--include/tpm-common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/tpm-common.h b/include/tpm-common.h
index f9c2ca2053..702cd6e93b 100644
--- a/include/tpm-common.h
+++ b/include/tpm-common.h
@@ -293,4 +293,7 @@ static inline cmd_tbl_t *get_tpm2_commands(unsigned int *size)
*/
enum tpm_version tpm_get_version(struct udevice *dev);
+/* Iterate on all TPM devices */
+#define for_each_tpm_device(dev) uclass_foreach_dev_probe(UCLASS_TPM, (dev))
+
#endif /* __TPM_COMMON_H */