From: Philippe Reynes Date: Thu, 9 Jan 2020 17:45:45 +0000 (+0100) Subject: tpm: add a helper to iterate on all tpm devices X-Git-Tag: v2025.01-rc5-pxa1908~2561^2~39 X-Git-Url: http://git.dujemihanovic.xyz/html/index.html?a=commitdiff_plain;h=bb3f47eb78ea50bad5f1848bdac84a05116c395d;p=u-boot.git 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 Reviewed-by: Miquel Raynal --- 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 */