From patchwork Mon Jun 6 15:56:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 69425 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1551771qgf; Mon, 6 Jun 2016 09:00:09 -0700 (PDT) X-Received: by 10.66.251.72 with SMTP id zi8mr18789229pac.19.1465228809667; Mon, 06 Jun 2016 09:00:09 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id d129si17282167pfa.184.2016.06.06.09.00.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jun 2016 09:00:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org 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 1b9wvj-0008IF-9t; Mon, 06 Jun 2016 15:59:07 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b9wvQ-00084Y-3L for linux-arm-kernel@lists.infradead.org; Mon, 06 Jun 2016 15:58:49 +0000 Received: by mail-wm0-x234.google.com with SMTP id m124so78476821wme.1 for ; Mon, 06 Jun 2016 08:58:28 -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=5CYeUu+oierNxjBf8Fj06abaBTjQ0IjqJ5Hv9m6A1O0=; b=ButxYdo7FwOK09JBvGwbIwAxP/nQRfGQLiaO9rtYGIrYohCBUD6RYaUey26tQDwRZc ryYKkosKUtn8+SvUCDuNgCP8pkw45/u9Fw4zQ2Y7uLwOtUYC5Js14tr9wPPbAEPk4EWe Zfms4jKXB2yMSCTS/0qamXPrD3jiKooFJzu4g= 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=5CYeUu+oierNxjBf8Fj06abaBTjQ0IjqJ5Hv9m6A1O0=; b=ZXQABFQNRHPZNS52DFDZkZEWEwUqqYKliCXIFqLXiM1bSvGO0vBfYzUR8CoEvsPWed kbKjXWHD88Km60Gw7EdC1WmH8W7t+IKGQNmsgp0fGFv9BAX9gj7mWBQSiUcHLb1aRxpJ tdseDyXjqrULL/4pzmnYumZw4WLhlOssjo+EL1cuGz3mHMOXbJVvZBVQ91uuEtyUAUCO FRMGoZmKACIjiRxLozSQbKSI9aoWYfpS9KbbbslBIE7Nf+vL8WS/cQN4pkCZy5+ljgtk GSlphsHGBEspy10kndAiSkra+R30711VucaoFgs5r2arUulqtDJ7llVnjv5IZYD1Oo7Z 8Qqw== X-Gm-Message-State: ALyK8tKIxRKqw4a+jIQY5zpHsIbHrleFxumXc7JnR0Rw4iRQgwIrcIWkMcNT9y2yGIRoUXYm X-Received: by 10.28.218.10 with SMTP id r10mr12102115wmg.18.1465228706744; Mon, 06 Jun 2016 08:58:26 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jun 2016 08:58:26 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/7] reset: Reorder inline reset_control_get*() wrappers Date: Mon, 6 Jun 2016 16:56:49 +0100 Message-Id: <20160606155655.10860-2-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_085848_323123_4F80DFBD X-CRM114-Status: GOOD ( 14.03 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:234 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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+patch=linaro.org@lists.infradead.org We're about to split the current API into two, where consumers will be forced to be explicit when requesting reset lines. The choice will be to either the call the *_exclusive or *_shared variant depending on whether they can actually tolorate not being asserted when that request is made. The new API will look like this once reorded and complete: reset_control_get_exclusive() reset_control_get_shared() reset_control_get_optional_exclusive() reset_control_get_optional_shared() of_reset_control_get_exclusive() of_reset_control_get_shared() of_reset_control_get_exclusive_by_index() of_reset_control_get_shared_by_index() devm_reset_control_get_exclusive() devm_reset_control_get_shared() devm_reset_control_get_optional_exclusive() devm_reset_control_get_optional_shared() devm_reset_control_get_exclusive_by_index() devm_reset_control_get_shared_by_index() Signed-off-by: Lee Jones --- include/linux/reset.h | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) -- 2.8.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/include/linux/reset.h b/include/linux/reset.h index ec0306ce..33eaf11 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h @@ -107,12 +107,6 @@ static inline struct reset_control *__must_check reset_control_get( return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0); } -static inline struct reset_control *reset_control_get_optional( - struct device *dev, const char *id) -{ - return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0); -} - /** * reset_control_get_shared - Lookup and obtain a shared reference to a * reset controller. @@ -141,6 +135,12 @@ static inline struct reset_control *reset_control_get_shared( return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1); } +static inline struct reset_control *reset_control_get_optional( + struct device *dev, const char *id) +{ + return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0); +} + /** * of_reset_control_get - Lookup and obtain an exclusive reference to a * reset controller. @@ -191,6 +191,21 @@ static inline struct reset_control *__must_check devm_reset_control_get( return __devm_reset_control_get(dev, id, 0, 0); } +/** + * devm_reset_control_get_shared - resource managed reset_control_get_shared() + * @dev: device to be reset by the controller + * @id: reset line name + * + * Managed reset_control_get_shared(). For reset controllers returned from + * this function, reset_control_put() is called automatically on driver detach. + * See reset_control_get_shared() for more information. + */ +static inline struct reset_control *devm_reset_control_get_shared( + struct device *dev, const char *id) +{ + return __devm_reset_control_get(dev, id, 0, 1); +} + static inline struct reset_control *devm_reset_control_get_optional( struct device *dev, const char *id) { @@ -213,21 +228,6 @@ static inline struct reset_control *devm_reset_control_get_by_index( } /** - * devm_reset_control_get_shared - resource managed reset_control_get_shared() - * @dev: device to be reset by the controller - * @id: reset line name - * - * Managed reset_control_get_shared(). For reset controllers returned from - * this function, reset_control_put() is called automatically on driver detach. - * See reset_control_get_shared() for more information. - */ -static inline struct reset_control *devm_reset_control_get_shared( - struct device *dev, const char *id) -{ - return __devm_reset_control_get(dev, id, 0, 1); -} - -/** * devm_reset_control_get_shared_by_index - resource managed * reset_control_get_shared * @dev: device to be reset by the controller