Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2283621imu; Thu, 29 Nov 2018 02:30:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/WlmXa4ZiGHRoAnNVaBb0zWF+N78XPyLvnUiSMx/rBMSPsy+FIfOLEhFkjmzy1cWhC1undH X-Received: by 2002:a62:a1a:: with SMTP id s26mr846339pfi.31.1543487441461; Thu, 29 Nov 2018 02:30:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543487441; cv=none; d=google.com; s=arc-20160816; b=EifKGSYOJF4TcEV5IeR/27YZ+KrnNTSQWbagKU3vsrvwW2mMy+h0PFuoU5Q1vMFaJf 05916NvogdmNQ+IR4yDPusOGySr9M/BNEnjGLx3HRKrtP/b3XINb7YowZGD2Nb1qjTLg bFlWOi5u5VVEIJau7r6Phwgxv6OXK2fGqDXz0fIn7AUhuLcBKtQdorl7Q0uD1+k9UAkn vpSiwYxLDzyCAVlAc5j0ikkM+IsktHZzwthvuhJBzy45N+sXC/jdqcAnY2jnzMW5rU/l quqxwL1UFf6rwta1tuR/TEvTitSWKpnjFtIcMkhH/MXe2YsdI5FQM7XMYGnx5xVPZgXf 9elA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=b/cQUv8EXgfgUWSo7q2NzPtuQq2YDmizWtHpRFPfYsw=; b=XiJG9qXoXevA+BT43OE7tACHe+0XrjwAaX5RkeJNFp9O3NTkpvF8f0E39o8/iPpxLh mrNUT4INuQqCS8UuN3rKmKAww3H8MU9irmpRsRAizyToZvFVSjvoD5W5Gq5Gh95V234f sG+YktlqZoJOnE/VXBu3i1zNiko88NcBvtz36g3RK7pWH4QsOwSqvHnMPDMjfydqRMQK SHdDxtpHHQzKz4AF7qjZhJmmBA5X7TdmDK6yD3Yd08nBR6NPv8mmN8ynudT/90+J41Z9 OEH5AvgRCpv7YI7LDp+aE8JsA7MdYYEW8f4q/BPu1Y/VdMiRvOSumQ1ZYBIoSmzUiy5/ 7E3w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si1458452pgv.499.2018.11.29.02.30.25; Thu, 29 Nov 2018 02:30:41 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728080AbeK2VdS (ORCPT + 99 others); Thu, 29 Nov 2018 16:33:18 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:46452 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbeK2VdS (ORCPT ); Thu, 29 Nov 2018 16:33:18 -0500 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id wATAODia003167; Thu, 29 Nov 2018 04:28:22 -0600 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail3.cirrus.com ([87.246.76.56]) by mx0b-001ae601.pphosted.com with ESMTP id 2p27228x3m-1; Thu, 29 Nov 2018 04:28:22 -0600 Received: from EX17.ad.cirrus.com (ex17.ad.cirrus.com [172.20.9.81]) by mail3.cirrus.com (Postfix) with ESMTP id 48501611C8B4; Thu, 29 Nov 2018 04:31:13 -0600 (CST) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.408.0; Thu, 29 Nov 2018 10:28:21 +0000 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id wATASLbb028814; Thu, 29 Nov 2018 10:28:21 GMT From: Charles Keepax To: CC: , , Subject: [PATCH 2/2] regulator: Allow regulator nodes to contain their own init data Date: Thu, 29 Nov 2018 10:28:21 +0000 Message-ID: <20181129102821.18396-3-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181129102821.18396-1-ckeepax@opensource.cirrus.com> References: <20181129102821.18396-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=854 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811290091 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently it is expected that regulator init data will be defined as a series of sub-nodes from the node that bound in the driver. Add support for a node to both bind in a driver and contain init data for that regulator. Signed-off-by: Charles Keepax --- drivers/regulator/of_regulator.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 4bb8928bdb3f..ffa5fc3724e4 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -380,12 +380,16 @@ struct device_node *regulator_of_get_init_node(struct device *dev, if (!dev->of_node || !desc->of_match) return NULL; - if (desc->regulators_node) + if (desc->regulators_node) { search = of_get_child_by_name(dev->of_node, desc->regulators_node); - else + } else { search = of_node_get(dev->of_node); + if (!strcmp(desc->of_match, search->name)) + return search; + } + if (!search) { dev_dbg(dev, "Failed to find regulator container node '%s'\n", desc->regulators_node); -- 2.11.0