diff mbox series

[V3,1/2] tpm: add a helper to iterate on all tpm devices

Message ID 1578591946-1139-1-git-send-email-philippe.reynes@softathome.com
State Accepted
Commit bb3f47eb78ea50bad5f1848bdac84a05116c395d
Headers show
Series [V3,1/2] tpm: add a helper to iterate on all tpm devices | expand

Commit Message

Philippe REYNES Jan. 9, 2020, 5:45 p.m. UTC
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 at softathome.com>
---
 include/tpm-common.h | 3 +++
 1 file changed, 3 insertions(+)

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

Comments

Philippe REYNES Jan. 9, 2020, 6:03 p.m. UTC | #1
Hi,

Sorry, I forgot to report the Reviewed-by of Miquel Raynal.


> Objet: [PATCH V3 1/2] 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 at softathome.com>

Reviewed-by: Miquel Raynal <miquel.raynal at bootlin.com>

> ---
> include/tpm-common.h | 3 +++
> 1 file changed, 3 insertions(+)
> 
> Changelog:
> v3:
> - use the helper uclass_foreach_dev_probe
> 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..702cd6e 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 */
> --
> 2.7.4

Regards,
Philippe
diff mbox series

Patch

diff --git a/include/tpm-common.h b/include/tpm-common.h
index f9c2ca2..702cd6e 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 */