public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH V2 1/2] tpm: add a helper to iterate on all tpm devices
@ 2020-01-09 14:25 Philippe Reynes
  2020-01-09 14:25 ` [PATCH V2 2/2] cmd: tpm: add a subcommand device Philippe Reynes
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Philippe Reynes @ 2020-01-09 14:25 UTC (permalink / raw)
  To: u-boot

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>
---
 include/tpm-common.h | 6 ++++++
 1 file changed, 6 insertions(+)

Changelog:
v2:
- new patch, add an helper for tpm device (idea from Miquel)

diff --git a/include/tpm-common.h b/include/tpm-common.h
index f9c2ca2..5b33f47 100644
--- a/include/tpm-common.h
+++ b/include/tpm-common.h
@@ -293,4 +293,10 @@ 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)			\
+	for (uclass_first_device(UCLASS_TPM, &(dev));	\
+	     (dev);					\
+	     uclass_next_device(&(dev)))
+
 #endif /* __TPM_COMMON_H */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-10  9:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-09 14:25 [PATCH V2 1/2] tpm: add a helper to iterate on all tpm devices Philippe Reynes
2020-01-09 14:25 ` [PATCH V2 2/2] cmd: tpm: add a subcommand device Philippe Reynes
2020-01-09 14:29   ` Miquel Raynal
2020-01-10  9:39   ` Simon Glass
2020-01-09 14:32 ` [PATCH V2 1/2] tpm: add a helper to iterate on all tpm devices Miquel Raynal
2020-01-10  9:39 ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox