From patchwork Mon Jun 6 15:56:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 9158695 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8E02860573 for ; Mon, 6 Jun 2016 16:01:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D2DE20700 for ; Mon, 6 Jun 2016 16:01:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 704BC267EC; Mon, 6 Jun 2016 16:01:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1231720700 for ; Mon, 6 Jun 2016 16:01:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b9wwE-0000Cq-Bc; Mon, 06 Jun 2016 15:59:38 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b9wvT-000859-4r for linux-arm-kernel@lists.infradead.org; Mon, 06 Jun 2016 15:58:52 +0000 Received: by mail-wm0-x233.google.com with SMTP id c74so53026505wme.0 for ; Mon, 06 Jun 2016 08:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mkgbOFCCKml63j4O3Ha4I2nVDDAcCLAYJtq7pACcJgI=; b=VjeACDr+lYFSBz5RPT1WwXopFSUgc9J0mUj4CbmvBx+yd7d+TEv82wyXCSXS8lob0p 1tGEskb+nLr7LGTs5cE47VUU18ScX8AXBRE9vJcEBrQiK33sOOq3EsPD9iOlQBu0qZhA UJhkYUZTUt/ofT9GjYXwGJpt5g0AI0uF3FzDs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mkgbOFCCKml63j4O3Ha4I2nVDDAcCLAYJtq7pACcJgI=; b=gEKM1Sr1Doag3Kl3qP/XP2EY8XZTEY0tipLd9TKAJQ+Q9mOCfb8C/LVg8No6ewopYG UG9eqCIHhkgqgMxVbHYgWEescnONtFjKGntOo3rcxQ3lid77q9qPwvJ1ZN9fY1i5nnHQ HlsP43rqK7yJTcjwxZgrkzXlzc7+Jfl2t0vrmPB2aetJN04frtSLKxHzyevLwg8KfC1N 9/XvGGg1ewMGBTkTeOqGutSv0LuP2RUlAWm6S5BRAqkptcLgHqdYgrIZEs/+QddpXQaq jk0Vea0IlcVw/QKq7xB49vEsOVgbNBZ+glPkvS6U9MlFdMSz1qnws69munED/CrXTRXT M5BA== X-Gm-Message-State: ALyK8tKl8BGLLqM2Fl4D/VpUzqvO/fkmeD3VYwjFMGKPlDuowUOrlx19nmbBGvelR6Pea88I X-Received: by 10.194.84.74 with SMTP id w10mr16310817wjy.118.1465228709583; Mon, 06 Jun 2016 08:58:29 -0700 (PDT) Received: from localhost.localdomain (host81-129-171-215.range81-129.btcentralplus.com. [81.129.171.215]) by smtp.gmail.com with ESMTPSA id h2sm20926040wjv.15.2016.06.06.08.58.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jun 2016 08:58:29 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] reset: Supply *_shared variant calls when using *_optional APIs Date: Mon, 6 Jun 2016 16:56:52 +0100 Message-Id: <20160606155655.10860-5-lee.jones@linaro.org> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160606155655.10860-1-lee.jones@linaro.org> References: <20160606155655.10860-1-lee.jones@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160606_085851_507353_A9D340F9 X-CRM114-Status: GOOD ( 11.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: balbi@kernel.org, kernel@stlinux.com, srinivas.kandagatla@gmail.com, linux-usb@vger.kernel.org, kishon@ti.com, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, Lee Jones , maxime.coquelin@st.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Consumers need to be able to specify whether they are requesting an 'exclusive' or 'shared' reset line no matter which API (of_*, devm_*, etc) they are using. This change allows users of the optional_* API in particular to specify that their request is for a 'shared' line. Signed-off-by: Lee Jones --- include/linux/reset.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/reset.h b/include/linux/reset.h index fd69240..c358106 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h @@ -141,6 +141,12 @@ static inline struct reset_control *reset_control_get_optional_exclusive( return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0); } +static inline struct reset_control *reset_control_get_optional_shared( + struct device *dev, const char *id) +{ + return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1); +} + /** * of_reset_control_get_exclusive - Lookup and obtain an exclusive reference * to a reset controller. @@ -270,6 +276,12 @@ static inline struct reset_control *devm_reset_control_get_optional_exclusive( return __devm_reset_control_get(dev, id, 0, 0); } +static inline struct reset_control *devm_reset_control_get_optional_shared( + struct device *dev, const char *id) +{ + return __devm_reset_control_get(dev, id, 0, 1); +} + /** * devm_reset_control_get_exclusive_by_index - resource managed * reset_control_get_exclusive()