cmd: Correct the 'md.q' command
[oweals/u-boot.git] / lib / tpm-common.c
index 6afe59b1fecf28ca603a569a50656c06b59a899b..e4af87f76aa7aa13c47acd2109a42a755d7bef60 100644 (file)
@@ -8,10 +8,18 @@
 
 #include <common.h>
 #include <dm.h>
+#include <log.h>
 #include <asm/unaligned.h>
 #include <tpm-common.h>
 #include "tpm-utils.h"
 
+enum tpm_version tpm_get_version(struct udevice *dev)
+{
+       struct tpm_chip_priv *priv = dev_get_uclass_priv(dev);
+
+       return priv->version;
+}
+
 int pack_byte_string(u8 *str, size_t size, const char *format, ...)
 {
        va_list args;
@@ -112,7 +120,7 @@ int unpack_byte_string(const u8 *str, size_t size, const char *format, ...)
 
                if (offset + length > size) {
                        va_end(args);
-                       log_err("Failed to read: size=%d, offset=%x, len=%x\n",
+                       log_err("Failed to read: size=%zd, offset=%zx, len=%zx\n",
                                size, offset, length);
                        return -1;
                }