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: 69427 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1551940qgf; Mon, 6 Jun 2016 09:00:31 -0700 (PDT) X-Received: by 10.107.59.18 with SMTP id i18mr22832451ioa.161.1465228831436; Mon, 06 Jun 2016 09:00:31 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s127si683609pfb.79.2016.06.06.09.00.31; Mon, 06 Jun 2016 09:00:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753153AbcFFQAR (ORCPT + 31 others); Mon, 6 Jun 2016 12:00:17 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38546 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752546AbcFFP6b (ORCPT ); Mon, 6 Jun 2016 11:58:31 -0400 Received: by mail-wm0-f54.google.com with SMTP id m124so78478322wme.1 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=dxUTNZfMIh4P/RT5lJ8yDp/5x26nt3AMiSlItOQRcKhj/WOCPG2+vR5r8VLzM8lkJn NYni91ghgWDenEtmilCHe14noITPxgp3XGL1IPisvpzEIepgZANgsCNQlnc4caSF/jSK kKvcZ+Dgeag5cI9D8Y9+Gw5uDu5qqpe+gTxUYgpRVvEdkUdWEI9Ck7KZ/jWuCa+lg+uw 9K7b4G3ZhgrbrXHZp168wdVaxAAkjh978iS4nXXHfdsSbqRxXi3V2MF0gMJu8p03aM1g kIEI9/PMHLJ93jadSfHK7UQgcY3e0TxorclSp4nRmZLGPEWmJfXD6QnFaa8vdNu6Fzgk Aifw== X-Gm-Message-State: ALyK8tJzmOiZl+aj5ch/K6wID27mzdPuJ11aY8Ha5BfXVyHtWTDj/i/EjrlDYaJyodfnMij+ 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 Cc: kernel@stlinux.com, maxime.coquelin@st.com, srinivas.kandagatla@gmail.com, kishon@ti.com, balbi@kernel.org, gregkh@linuxfoundation.org, p.zabel@pengutronix.de, linux-usb@vger.kernel.org, Lee Jones 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.8.3 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()