From patchwork Thu Nov 11 04:06:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathew McBride X-Patchwork-Id: 1553757 X-Patchwork-Delegate: apalos@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=traverse.com.au header.i=@traverse.com.au header.a=rsa-sha256 header.s=fm2 header.b=jXTnFZ+e; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=FD5V3IiV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HqSpn0dkMz9s1l for ; Thu, 11 Nov 2021 15:07:13 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 56D1583742; Thu, 11 Nov 2021 05:06:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=traverse.com.au header.i=@traverse.com.au header.b="jXTnFZ+e"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="FD5V3IiV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 193BE835A8; Thu, 11 Nov 2021 05:06:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E0D64835A8 for ; Thu, 11 Nov 2021 05:06:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=matt@traverse.com.au Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 158AA5C0218; Wed, 10 Nov 2021 23:06:48 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 10 Nov 2021 23:06:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=traverse.com.au; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=ZmiWFA1moMbr0 g7kM5XBaQxDudAkkZxt5GyKKyh5zg8=; b=jXTnFZ+eLNtWt4tWOOsw0E3Vs2Xn+ KWRNx5yLi4BfwyUSsu9IBsleBsD6kGLFX7xDlhfLwmzBIapIaMM5erD8/H3T962O sG60N3p19L8v7jiznzigJ+n6WFOIj+XpXv2lnBkVJisdyDsMjqASFsP90XsIjZil SposNxr2/Zu3WH943rsw3CSzafZ5vAMzx2rABv2eC5VU+20gMiX9+taFVjQ7vfSj V+cshPqGCil18r3F1S2hbtDu55Mv+/4UJqnvxEc/ui17WARm0G5sZH5UEyw7/0FZ gTcL6SzN/kJTAG3QqOhrhtAwYRrSDT1JnV1dXeO+7NpjuphFAHsKwGvYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=ZmiWFA1moMbr0g7kM5XBaQxDudAkkZxt5GyKKyh5zg8=; b=FD5V3IiV nH3qrBF722EGThpsTi7idFs/3yLcqpMtMinhVU8v46E04YnK5kzkMZZZ4SEmi8c8 98p2JqoDmKPRJf/rLrQLaZZospNxXrLPgNZJpXAXh96kg0zMtEBRHsIWlr+yPbXd 0QUgJTmfuvp2Adk7ffEOFieBK5ond9Qkz+tXv/jCBndtod+QL8qW6jIErhoKLUMB yCyKEucj/+uC7yw8/g0N4sAR0iLwNy0aBC9PoStKERz0VK87ZzSiHdISvMm+QgAP YGrIiBROTNplVPwPzg2HMhPwZ2NrOl81A/c0AFoFkfFvFVbFIzUqz65cSCvm6GjS HD6ZD3tTfdUD7g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrvddtgdeifecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrthhhvgif ucfotgeurhhiuggvuceomhgrthhtsehtrhgrvhgvrhhsvgdrtghomhdrrghuqeenucggtf frrghtthgvrhhnpeekleevteelvdduheetgfdvfeelueekffeggeethedtteeljeeivedv gfehjeejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmrghtthesthhrrghvvghrshgvrdgtohhmrdgruh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Nov 2021 23:06:45 -0500 (EST) From: Mathew McBride To: Ilias Apalodimas , eugen.hristev@microchip.com, sjg@chromium.org, u-boot@lists.denx.de Cc: Mathew McBride Subject: [PATCH v2 1/6] cmd: tpm-v1: fix compile error in TPMv1 list resources command Date: Thu, 11 Nov 2021 04:06:26 +0000 Message-Id: <20211111040631.21262-2-matt@traverse.com.au> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20211111040631.21262-1-matt@traverse.com.au> References: <20211111040631.21262-1-matt@traverse.com.au> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean This command is not compiled by default and was not updated to pass the udevice to tpm_get_capability. Signed-off-by: Mathew McBride Reviewed-by: Ilias Apalodimas Reviewed-by: Simon Glass --- cmd/tpm-v1.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/tpm-v1.c b/cmd/tpm-v1.c index 3a7e35d525..55f2aeff46 100644 --- a/cmd/tpm-v1.c +++ b/cmd/tpm-v1.c @@ -582,6 +582,7 @@ static int do_tpm_flush(struct cmd_tbl *cmdtp, int flag, int argc, static int do_tpm_list(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { + struct udevice *dev; int type = 0; u16 res_count; u8 buf[288]; @@ -589,6 +590,10 @@ static int do_tpm_list(struct cmd_tbl *cmdtp, int flag, int argc, int err; uint i; + err = get_tpm(&dev); + if (err) + return err; + if (argc != 2) return CMD_RET_USAGE; @@ -619,7 +624,7 @@ static int do_tpm_list(struct cmd_tbl *cmdtp, int flag, int argc, } /* fetch list of already loaded resources in the TPM */ - err = tpm_get_capability(TPM_CAP_HANDLE, type, buf, + err = tpm_get_capability(dev, TPM_CAP_HANDLE, type, buf, sizeof(buf)); if (err) { printf("tpm_get_capability returned error %d.\n", err);