From patchwork Thu Jan 10 18:40:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1023168 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="JGGx5QVJ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43bFdy4z6Xz9sCh for ; Fri, 11 Jan 2019 05:59:02 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 18855C2213B; Thu, 10 Jan 2019 18:51:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5C350C22179; Thu, 10 Jan 2019 18:46:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 461B0C22177; Thu, 10 Jan 2019 18:46:09 +0000 (UTC) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by lists.denx.de (Postfix) with ESMTPS id 295B7C22121 for ; Thu, 10 Jan 2019 18:44:53 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id d72so5172899pga.9 for ; Thu, 10 Jan 2019 10:44:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qg6YPS72A12gb23Pr24tBDMVVvvuapr2cUZ9PT2QmjI=; b=JGGx5QVJP3jN8scZFTFfEsggv/chMlsRQ/DwZW8H8Yd6kePoe8fXDhy2QLcmDhE8t7 hAM+VX6pY5ztRVuUpPDwQUXggqg+SJ86EWa/FvGNkGpZFj4yUdVtZ9sKoQuOAzv+ARd6 VH58HYxV8rx705bwQWAetRxea92MuYbVi/jJI= 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=Qg6YPS72A12gb23Pr24tBDMVVvvuapr2cUZ9PT2QmjI=; b=E0cqRmwSV0ZKHa7AYgjecWeEQxknY6AHYP9N6mIFdZIt4RP0HWhtupgWneA2W1t0Ee 2LzzsbJ2xqQ6Ie/W2RufyIXmZz8PqYIX6Akf8FngFJktEvVZd6ASw2nnizVWuY/qSxlx n+kreYFpJNEh37tmhXtJtVBRmBrV7+m8lAo0f0vRkOfXbasth9xXEvnMbZiEd7EMxJNK 0AbgDyfjXbVtcj5PUK8JFfh27EDMZ0nMw1RBXFFUv/D+UvYme3Y3XmL1aR5bSvVdPg3U yP/wpUffxQ0LwX7GGguiUS/uK+gQxoIOjBXEUWL6i8474I9saytfpRroWXshKxtmL+7r WrWQ== X-Gm-Message-State: AJcUukedFH/XRgVy24lzzC1PRYjtVCzl/tlnjh2p+wqYm2i3h8o4BG8v 76cLju5GMGv+V8l5iWSOOlck5A== X-Google-Smtp-Source: ALg8bN4X4KEUrh9bhLKe+fq1a4dfWKt+eF7UQrWNAYoQMC0H7LELiqOX7TFPlhHnDZR6NqApDCxa6A== X-Received: by 2002:a63:a611:: with SMTP id t17mr10238186pge.338.1547145891851; Thu, 10 Jan 2019 10:44:51 -0800 (PST) Received: from localhost.localdomain ([49.206.202.55]) by smtp.gmail.com with ESMTPSA id t90sm156370546pfj.23.2019.01.10.10.44.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 10:44:51 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Andre Przywara , Chen-Yu Tsai , Simon Glass , Tom Rini , u-boot@lists.denx.de, linux-sunxi@googlegroups.com, Michael Trimarchi , linux-amarula@amarulasolutions.com Date: Fri, 11 Jan 2019 00:10:13 +0530 Message-Id: <20190110184016.17027-18-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190110184016.17027-1-jagan@amarulasolutions.com> References: <20190110184016.17027-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH v6 17/20] reset: Add reset valid X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Add reset_valid to check whether given reset is valid or not. Cc: Simon Glass Signed-off-by: Jagan Teki --- include/reset.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/reset.h b/include/reset.h index bc495a90c2..65aa7a4ce5 100644 --- a/include/reset.h +++ b/include/reset.h @@ -306,4 +306,15 @@ static inline int reset_release_bulk(struct reset_ctl_bulk *bulk) } #endif +/** + * reset_valid() - check if reset is valid + * + * @reset_ctl: the reset to check + * @return TRUE if valid, or FALSE + */ +static inline bool reset_valid(struct reset_ctl *reset_ctl) +{ + return !!reset_ctl->dev; +} + #endif