From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762158AbcALCSW (ORCPT ); Mon, 11 Jan 2016 21:18:22 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:54724 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753955AbcALCSV (ORCPT ); Mon, 11 Jan 2016 21:18:21 -0500 Subject: Re: [PATCH v5 4/5] regulator: add regulator driver of hi655x pmic To: Mark Brown References: <1452514817-118311-1-git-send-email-puck.chen@hisilicon.com> <1452514817-118311-5-git-send-email-puck.chen@hisilicon.com> <20160111182444.GR6588@sirena.org.uk> CC: , , , , , , , , , , , , , , , , From: chenfeng Message-ID: <5694625B.9060304@hisilicon.com> Date: Tue, 12 Jan 2016 10:18:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20160111182444.GR6588@sirena.org.uk> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.192.172] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.5694626A.009D,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 49dc8dc0810a937b15ef97c8030297dd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/1/12 2:24, Mark Brown wrote: > On Mon, Jan 11, 2016 at 08:20:16PM +0800, Chen Feng wrote: > >> +config REGULATOR_HI655X >> + tristate "Hisilicon HI655X PMIC regulators support" >> + depends on ARCH_HISI || (COMPILE_TEST && ARM64) > > Why does this depend on ARM64? If it's needed it probably indicates a > problem... > There will be compile warning with arch parisc. Add the current support platform is ARM64. >> + np = of_get_child_by_name(dev->parent->of_node, "regulators"); >> + if (!np) >> + return -ENODEV; >> + >> + ret = of_regulator_match(dev, np, >> + hi655x_regulator_match, >> + ARRAY_SIZE(hi655x_regulator_match)); > > Like I said on the previous version: > > | Don't open code this, use the standard support with of_match and > | regulators_node. > > The code is now using of_match but still open coding regulators_node. > I am not sure about open coding regulators_node. I take max8907-regulator.c for reference. The code there is: 224 static int max8907_regulator_parse_dt(struct platform_device *pdev) 225 { 226 struct device_node *np, *regulators; 227 int ret; 228 229 np = pdev->dev.parent->of_node; 230 if (!np) 231 return 0; 232 233 regulators = of_get_child_by_name(np, "regulators"); ... 238 239 ret = of_regulator_match(&pdev->dev, regulators, max8907_matches, 240 ARRAY_SIZE(max8907_matches)); 249 } Can you give me some references? Really thanks for your help. ChenFeng