Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1803375yba; Thu, 25 Apr 2019 06:05:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzizl1oXt62ZBgPIMdOkuNWirysPphCqqWP46V2cnUB/tNeGN+Gzbl5EtPwwJAP7O9Zreo6 X-Received: by 2002:a63:6804:: with SMTP id d4mr37210193pgc.240.1556197518484; Thu, 25 Apr 2019 06:05:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556197518; cv=none; d=google.com; s=arc-20160816; b=oZVcojVDOu5uyshGFQ6/zN743fdygHrIcJ9bcchxCVVk3n5yBV4eayyZfEsdhC+l01 4RYKn9mtyMH9/Dv41oolOZuKQqrJMNLdCRBUbd4zL80HW9Abn/yDmOaTBu4bqVJuqpmE oaxEFG2Aac46qcDP3k9X231Eh2ZkcrPHyxuMOyqz0WlDnb44GLZ+7jpDzVvYmTpwwXRV TLU6AI5gcAK6WGSASbkloSuTCOQRprpbXkRLm/yXzfIY6obmPr5l0sSLaDo60GgI3dBJ 551JXMhuk3pTQgjP/p4Mua0SHO0OxTf2RzjbLf6TtKN6JPwLsMzxfOLyithLrmKHm+yo ABwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=n6We9u0YVFu6BkGTUjZMuv7muCNOIm37EIbnAFUWC8g=; b=YBqTeMBXCloC+AYNqbYfqk3Nnp3XlxkyfQVD9smjV6EDfnQ2WtFmPomsRijTIjwaZ1 mkFJrrAt0L04Cu2QepLakC61KddTrGonLhpcz+KWaBuAx8lU10e07f1rtEb8s+DRLI15 7lOOA/fmDH0soWVNTaEcJ3XYtXEIxHD5hE4DyUYl1ojNvtq2Czh3kjvAC27yAZf7TmcS V9mOBf+0/flO9M+bJlKpprXMSmaOuxmGlc129djaPt9RzdvbyMf0DROidFwYq8uXF7mE KqjCGKoEo/TTok4SSMei4kpmxMYQOWg2z8zXqf/FqW4eZU+ryFUzoAPGSJLbrDG3S1oK mYfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jXgd8d1Y; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s145si20996099pgs.228.2019.04.25.06.04.49; Thu, 25 Apr 2019 06:05:18 -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=@ti.com header.s=ti-com-17Q1 header.b=jXgd8d1Y; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730286AbfDYKFW (ORCPT + 99 others); Thu, 25 Apr 2019 06:05:22 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:38626 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbfDYKFW (ORCPT ); Thu, 25 Apr 2019 06:05:22 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3PA5DuW031693; Thu, 25 Apr 2019 05:05:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1556186713; bh=n6We9u0YVFu6BkGTUjZMuv7muCNOIm37EIbnAFUWC8g=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=jXgd8d1YGWqAWDpKPaUvtj++fpSX74D5AGeYkivKJFL+DV4DpwH1wfm+hwtJYzjSf CVlTXFxBNfHkbpOHxIizsc/eHVDQFyv8ovg/TSl+Ji4fQ+zbwJyqK1/jXau56+WE55 bjpoXbCZpcaQpISq1iRTb29MIEYHRPxozf5R6wAg= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3PA5DkL006119 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 25 Apr 2019 05:05:13 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 25 Apr 2019 05:05:13 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 25 Apr 2019 05:05:13 -0500 Received: from [172.22.129.216] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3PA5A8f033746; Thu, 25 Apr 2019 05:05:10 -0500 Subject: Re: [RFC PATCH v3 net-next 01/11] net: ethernet: ti: cpts: use devm_get_clk_from_child To: Andrew Lunn CC: , Ilias Apalodimas , "David S . Miller" , Ivan Khoronzhuk , Jiri Pirko , Florian Fainelli , Sekhar Nori , , , Murali Karicheri , Ivan Vecera References: <1556144667-27997-1-git-send-email-grygorii.strashko@ti.com> <1556144667-27997-2-git-send-email-grygorii.strashko@ti.com> <20190424224607.GB23779@lunn.ch> From: Grygorii Strashko Message-ID: <3aae7697-3b7f-492b-0600-b6d1382511c3@ti.com> Date: Thu, 25 Apr 2019 13:05:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190424224607.GB23779@lunn.ch> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.04.19 01:46, Andrew Lunn wrote: > On Thu, Apr 25, 2019 at 01:24:17AM +0300, Grygorii Strashko wrote: >> Use devm_get_clk_from_child() instead of devm_clk_get() and this way allow >> to group CPTS DT properties in sub-node for better code readability and >> maintenance. >> >> Signed-off-by: Grygorii Strashko >> --- >> drivers/net/ethernet/ti/cpts.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c >> index 499806ce4cd5..aad118e71b61 100644 >> --- a/drivers/net/ethernet/ti/cpts.c >> +++ b/drivers/net/ethernet/ti/cpts.c >> @@ -572,7 +572,7 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs, >> if (ret) >> return ERR_PTR(ret); >> >> - cpts->refclk = devm_clk_get(dev, "cpts"); >> + cpts->refclk = devm_get_clk_from_child(dev, node, "cpts"); >> if (IS_ERR(cpts->refclk)) { >> dev_err(dev, "Failed to get cpts refclk\n"); >> return ERR_CAST(cpts->refclk); > > Hi Grygorii > > Does this break backwards compatibility for existing DT blobs? > Maybe you need to look in both the old and new locations? No. It doesn't - default node is cpsw->dev->of_node. Then Patch 7 changes it fro new driver to - cpsw->cpts = cpts_create(cpsw->dev, cpts_regs, cpsw->dev->of_node); + cpts_node = of_get_child_by_name(cpsw->dev->of_node, "cpts"); + if (!cpts_node) + cpts_node = cpsw->dev->of_node; + + cpsw->cpts = cpts_create(cpsw->dev, cpts_regs, cpts_node); -- Best regards, grygorii