tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/cmd/tpm-common.c b/cmd/tpm-common.c
index 5644386..89f2aa0 100644
--- a/cmd/tpm-common.c
+++ b/cmd/tpm-common.c
@@ -264,10 +264,16 @@
 
 int do_tpm_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
+	struct udevice *dev;
+	int rc;
+
 	if (argc != 1)
 		return CMD_RET_USAGE;
+	rc = get_tpm(&dev);
+	if (rc)
+		return rc;
 
-	return report_return_code(tpm_init());
+	return report_return_code(tpm_init(dev));
 }
 
 int do_tpm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])