Message ID | 20200407210023.v4.8.Ic7e63c1f960c3adab3a1c03a61a56c4199fc7074@changeid |
---|---|
State | Superseded |
Delegated to: | Bin Meng |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=FYPmE3sS; dkim-atps=neutral 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48xpy21v1Wz9sPF for <incoming@patchwork.ozlabs.org>; Wed, 8 Apr 2020 13:03:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EDA6A819BC; Wed, 8 Apr 2020 05:01:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="FYPmE3sS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D87268198D; Wed, 8 Apr 2020 05:01:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7B2BE8190C for <u-boot@lists.denx.de>; Wed, 8 Apr 2020 05:01:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd41.google.com with SMTP id u2so5634047iop.10 for <u-boot@lists.denx.de>; Tue, 07 Apr 2020 20:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e3EBODb2YX8zhtNYn9I3G1QuxUrzaeCu43TJBuRtk9I=; b=FYPmE3sST2NmfBteOhaa8TSYmGCDzeaPWpnudUwJ2kSa8nu2j7BX1idYy9+rXU6azW H8nO/rNibh01bozKAAyugBYsUElsU736duAa4Ffkh0azB9qA3jPs7vJX50bfbUiKG8pr JsDuPnfS4fY+NnW3jUEWT2xFibkBuVr3Vl2jA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e3EBODb2YX8zhtNYn9I3G1QuxUrzaeCu43TJBuRtk9I=; b=Swziv4ETpiuCxefYjDHJbCrKliyoOwpkZjRrkBhuuF2FeFzR1314pBl9/XDgzoLVvt 5Fm5M+ZhY1oPKCI85M6iv0flGXMte5I6zrX+jpfOyEcXl4qCiYFBQKSZ+Jt77CN3+fhm XYo+35fxvoWcUYaKKJhxbYQTZ1rjtYwlxGfY715odJpl30rY/3lHN12yI/qrGr9xl08C nONVXbK0WkesLmA0rnrzQu8f+0EGiB84Git1lys2IQe1Owq1OKcK5JoCEE+ZKc+dkAM5 KQOxkG1p0OL9jF/SANQSEhPQgt/ibGdlhyNpu7Y7PHB9m36/jnrFor7zhFZyD7apQiTB R2Tw== X-Gm-Message-State: AGi0PuZFd8qoRxGnwKbzUxbWQfm2f2lpNf4UmaoFrBN3TYncd8wrePsE UNsWzFQXqga7wH/YBomO1utVaBR3GF3H1g== X-Google-Smtp-Source: APiQypIHXVd4KPayZguqgTCOZ+TECut1I1nKeymaE3GMjwPiwKQO1UeH71GLaXbV5I+F/4kVYPcftg== X-Received: by 2002:a02:2715:: with SMTP id g21mr3465348jaa.18.1586314899212; Tue, 07 Apr 2020 20:01:39 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id l6sm7732310ilh.27.2020.04.07.20.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2020 20:01:38 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Cc: Wolfgang Wallner <wolfgang.wallner@br-automation.com>, Bin Meng <bmeng.cn@gmail.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Leif Lindholm <leif@nuviainc.com>, Simon Glass <sjg@chromium.org> Subject: [PATCH v4 08/31] tpm: Don't cleanup unless an error happens Date: Tue, 7 Apr 2020 21:00:44 -0600 Message-Id: <20200407210023.v4.8.Ic7e63c1f960c3adab3a1c03a61a56c4199fc7074@changeid> X-Mailer: git-send-email 2.26.0.292.g33ef6b2f38-goog In-Reply-To: <20200408030107.168474-1-sjg@chromium.org> References: <20200408030107.168474-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean |
Series |
dm: Add programmatic generation of ACPI tables (part A)
|
expand
|
diff --git a/drivers/tpm/tpm-uclass.c b/drivers/tpm/tpm-uclass.c index 1b11c93194d..71d58070062 100644 --- a/drivers/tpm/tpm-uclass.c +++ b/drivers/tpm/tpm-uclass.c @@ -72,7 +72,7 @@ int tpm_xfer(struct udevice *dev, const uint8_t *sendbuf, size_t send_size, struct tpm_ops *ops = tpm_get_ops(dev); ulong start, stop; uint count, ordinal; - int ret, ret2; + int ret, ret2 = 0; if (ops->xfer) return ops->xfer(dev, sendbuf, send_size, recvbuf, recv_size); @@ -120,9 +120,16 @@ int tpm_xfer(struct udevice *dev, const uint8_t *sendbuf, size_t send_size, } } while (ret); - ret2 = ops->cleanup ? ops->cleanup(dev) : 0; + if (ret) { + if (ops->cleanup) { + ret2 = ops->cleanup(dev); + if (ret2) + return log_msg_ret("cleanup", ret2); + } + return log_msg_ret("xfer", ret); + } - return ret2 ? ret2 : ret; + return 0; } UCLASS_DRIVER(tpm) = {