From patchwork Wed May 28 17:11:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 4256611 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EBFB2BF90B for ; Wed, 28 May 2014 17:14:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2CAC32026C for ; Wed, 28 May 2014 17:14:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5715E201FA for ; Wed, 28 May 2014 17:14:47 +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 1WphOm-0001Vm-18; Wed, 28 May 2014 17:12:20 +0000 Received: from top.free-electrons.com ([176.31.233.9] helo=mail.free-electrons.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WphOb-0001CU-D8 for linux-arm-kernel@lists.infradead.org; Wed, 28 May 2014 17:12:15 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id E04B5837; Wed, 28 May 2014 19:11:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (189.58.26.109.rev.sfr.net [109.26.58.189]) by mail.free-electrons.com (Postfix) with ESMTPSA id 9AFB1815; Wed, 28 May 2014 19:11:26 +0200 (CEST) From: Maxime Ripard To: carlo@caione.org, Boris Brezillon , Mark Brown , lgirdwood@gmail.com, lee.jones@linaro.org Subject: [PATCH 2/5] regulator: Pass the config device node to regulator_dev_lookup Date: Wed, 28 May 2014 19:11:06 +0200 Message-Id: <1401297069-7423-3-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1401297069-7423-1-git-send-email-maxime.ripard@free-electrons.com> References: <1401297069-7423-1-git-send-email-maxime.ripard@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140528_101209_636568_72EBCD3D X-CRM114-Status: GOOD ( 10.67 ) X-Spam-Score: 0.3 (/) Cc: linux-kernel@vger.kernel.org, zhuzhenhua@allwinnertech.com, kevin.z.m.zh@gmail.com, sunny@allwinnertech.com, shuge@allwinnertech.com, Maxime Ripard , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 For now, regulator registers only looks for parent supplies in the struct device of_node. That means that single devices that expose several regulators in the DT have to tie the parent supplies to the parent device, instead of the regulator itself like described in the regulator bindings. The regulator device node is already present in the regulator_config structure that is passed to regulator_register. Use it to first match in the regulator node, and then to the device node itself. Signed-off-by: Maxime Ripard --- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 3e3954252a23..c8e26be5ea01 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -3503,7 +3503,7 @@ regulator_register(const struct regulator_desc *regulator_desc, if (supply) { struct regulator_dev *r; - r = regulator_dev_lookup(dev, NULL, supply, &ret); + r = regulator_dev_lookup(dev, config->of_node, supply, &ret); if (ret == -ENODEV) { /*