Ver código fonte

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>
Philippe Reynes 4 anos atrás
pai
commit
bb3f47eb78
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      include/tpm-common.h

+ 3 - 0
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 */