From abdc7b8a2d7f2b8527ce4f9133b777942af99126 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 18 Nov 2018 14:22:27 -0700 Subject: 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 --- cmd/tpm-common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cmd/tpm-common.c') 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_info(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) 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[]) -- cgit v1.1