Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753936AbcLIAUb (ORCPT ); Thu, 8 Dec 2016 19:20:31 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:35893 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752348AbcLIAU2 (ORCPT ); Thu, 8 Dec 2016 19:20:28 -0500 X-IronPort-AV: E=Sophos;i="5.33,321,1477926000"; d="scan'208";a="227473799" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <877f7aymxu.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Stephen Boyd CC: Russell King - ARM Linux , Rob Herring , Linux-ALSA , Linux-DT , Michael Turquette , Linux-Kernel , Mark Brown , , Linux-ARM Subject: Re: [PATCH 2/3] ASoC: simple-card: use devm_get_clk_from_child() In-Reply-To: <20161208220942.GO5423@codeaurora.org> References: <874m2jvtmw.wl%kuninori.morimoto.gx@renesas.com> <871sxnvtkp.wl%kuninori.morimoto.gx@renesas.com> <20161208220942.GO5423@codeaurora.org> User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="US-ASCII" Date: Fri, 9 Dec 2016 00:20:05 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OSXPR01CA0021.jpnprd01.prod.outlook.com (10.167.143.177) To PS1PR0601MB1452.apcprd06.prod.outlook.com (10.165.210.156) X-MS-Office365-Filtering-Correlation-Id: 8a424975-24a9-424f-5622-08d41fc920d8 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:PS1PR0601MB1452; X-Microsoft-Exchange-Diagnostics: 1;PS1PR0601MB1452;3:ztOFsTbdflZgfGhSCjwSV/ODD9FLVQWZWDHh1Fu4Kim6McKIcbIzsSdAYVZgt4LFM+plcDjolB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aYaia9rubNbnoZdlagSE/w+XnVXohP6VuhXgAYtpswm+s1knz6itZEITbXhiW9zQA30ZY2vUIDo48+aKsxNGZawNrhFouTt15TMMgAnw4yuFnrRnkkLqiFo/rTXpvFWF7qOr9CxYTlrdSDyOvlLORjo/VylZnCkjr5Zg2F5jAYw7JeNfPrsUObDYa5s1/WDeQmd+lcPUaSzIekzvo68Uc2mdW5VirZ7eLQQ9f53JhGPeCZJy2DJZwI7eRYw6TVOT8N3Sp5iZyxeaIUlb4oknnPSJZC3kSCEIw6drjZDaOQLzN4AxSMet0IGADPE4c3JSq5qhDhGiOXIItkdcjBsxx7pnqUkRv8iidDILPYGX+KcRRpLOAzAZH2q3zoKyvks2M6Sp4mZ3OksBa5QgcnXiDg2ztbyj2I/pF29EiRH1K1i0aq0ec0HF6kBajBpwJnRrbdaoLXGDGqOBFXMlBoEmSpGOSdWkmKqZVAqwj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6042181)(6072148);SRVR:PS1PR0601MB1452;BCL:0;PCL:0;RULEID:;SRVR:PS1PR0601MB1452; X-Microsoft-Exchange-Diagnostics: 1;PS1PR0601MB1452;4:MecgVNVPnfDcboB34WIJWGuNG+ybqG2FPLWB6msXLIJsHSq96qnT5u8sBnd2bbwB260v2jC9fcMPGAOMzOGxyurE8rLvZM5OA89r10prdLmGVLKJ39rwOCqag1y8tncRQDWVm590kRkb/zlKdKBfsneRm66YPwDYjn4NEhsrxr6HxRPuZxD5cx/PduTT8NprM+JSjcmcaf05hD+mJXnQdL1Q0RhyjrFT7lhO2S/Rq6nM6V1kzsBsJdImTFdvOjvn/tjpeTDHCyma9QmyOasp+kGZR+7Q31hrOu5U7Vr37H5eVAnMCYsI7dmZvINNByf0p4TURFZlPXp4RXRG1Rtq9KkVymps5abo95Y6Xz8XIE5Ugc/w9/x/4SCC+vdSEcao3r40tVRQFG271fjx1tQ5aXjtNj81ZzzI9JgVFNcS/r3/NMGCTk7LEKDM3mH9l1mmDSlIUm2lwxKpurNUzEXgCtgAy/frgIBVSxGUfbwDrZPCftNgg/lU8qECPGxYOC9vXPUNrN8rW64J4V91EgiHZwdaBjxGie8Smw5I3XXgsebU6WPeMIhkeb/yLpCBPe7KRsrXD8m3lKqYFCmCAIOZIhA0DNNfQMGrr2UjqZ0F8dw= X-Forefront-PRVS: 015114592F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(42186005)(36756003)(4326007)(106356001)(8676002)(50466002)(53416004)(7416002)(2906002)(189998001)(105586002)(33646002)(66066001)(47776003)(68736007)(76176999)(54356999)(83506001)(5660300001)(50986999)(101416001)(2950100002)(110136003)(6916009)(46406003)(229853002)(305945005)(86362001)(7736002)(23726003)(4001350100001)(6116002)(6486002)(733004)(81156014)(38730400001)(81166006)(3846002)(69596002)(92566002)(97736004)(21314002)(16060500001);DIR:OUT;SFP:1102;SCL:1;SRVR:PS1PR0601MB1452;H:morimoto-PC.renesas.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;PS1PR0601MB1452;23:IgafEySaHy3YmU+eXUdY2F3w7z8c94VFS7KexXD?= =?us-ascii?Q?70A+nOxgvcez420OrhK4SNTgXSc0nD/zug+3SZjI0saQY0g2aNoqQKPEi17O?= =?us-ascii?Q?wwmaaxPG3yq2o91KMVbIoVXMg8yiMO1nqI44NAcTm9heQe7M+L4irNvoJTTz?= =?us-ascii?Q?IL5NRTc2sV6Id33fWx9YPCeLCtfJb7kqxof1qdySRXgNY3cZcPY+DjbRv4bs?= =?us-ascii?Q?JQ6/fVQvOqGI6pW6ooDYhMH4Cwck8/krj157kgaqNnzTW7Kf4ws+WOhgHoI+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OY5NZZKd/3HUpqMUhU1JvXb950+Q=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1;PS1PR0601MB1452;6:hh3ApXGg1w6e9ZX+yLqoLV6wACfsKkfP0J4UYL/2Gqjgqy0K8X/ngEjH3vDDnk6L9GJ2lP4El03fXDYsF864q62F9P0YTzxZW7WclX4Ruvl8pCHq/CFNuuRiW84l20LB7eJyB8KpRNmdPIH5iAM/OapWAGpxIJofhVMaLdSfcfIDmmP+EMvYAxaXq72wNMVRCq8lxw5Kai815ODi6kThxQ82pNctBkLTJOmPeYI4r+m+PlqG10tH4depzff0gIwOEIcG1T5eC5G8z84eLk3WLDCHvw3F/G869smP+Q2Xjd3vvYVjWWqv9db5GDIMk1CvDWt0CaQEvMRPJgs66SkAtIQ+aC//pP9J9VJfIPnJWkj8yg733vmMWDGiXOzCt8Z+rg107d7SMe+Jw7OMz8S00otp3x+VLmvfeDzz1Co8OQm2bxfTsz2DqoeHwWzHAH6WjeYgDJ2RpP7BO/YiMUXYlcl/JL29rZE+M19VYyo0/Zo=;5:JP/44p3sIop+Ej/zNd+tO5onoS2rayT83ZF5899GMrCAaBl+H3CiGNzcgPotpkFBFeCRz+oTx9uFfO6HMWdDhnkXfjz9ex1R8dy+NjuRwVWvh1EfK/9fYFicAuzXsvksHI5nu1OvKKobLG61J5Xehw==;24:rocA3g4pvSFPIT52k8aK2ZJ4/nQfYTr+8E8NcOAC+0oxjvppm1GBeJFD9ngmeiM4bcKLPZO2iRH4OGxNcxXkrdJsI+8lYljE3VNK6LERvrs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;PS1PR0601MB1452;7:FHrdaR+A+GhahackTyzaAKmqXx9Y4AwvBJ+5pzQeKbp9QtLCipoCxwu7h8X3SuoqkIXumQJ94G/M2+MrugxGRIzqEtD7xVrVBQI89XsT8IiFNyYsRtX79uYfIV7tQNBJI0KYxuDQPhXynwAp6Y6WtLun4dsVLw89npBXUnuH84bd6PTg9tuK3CVcPjs9j8yqI4mplaKxruGoy8A4M8sSmmmEGsOEoDZ+5b5mQ3BvHdyMu16VVjs/f2sCPa7fUkDmgvoBf/rdkqP237uSv/U2KO/9Sa3RwxLi/Jsb2uIHZUGyDkZbyk1z9ltIY+my8vCswoZZrC0MaEnRibMeSCBBTWYay2rnDqNi8zHYrvXm3dSEXzZJLcxEd4366NNXr/gOX5FX49yuBR3aFYdENTyuLohaNhE5ZYvGgGNph+Cez1rF43b++ZWHCgPD4MyXMoT/Cx4epFBBG7wWBgZwGF1yOA==;20:Z1Rtuq/mMc9Cwz/UPrDQCd89UuwE3fWpK764qZ9Yc1/GW2ckZSw9jPa8Gegs/Oo8t0xQVOf80mrtDdP053M0jlJmYxZzBsaoXPH/obpOTIne1qIH1fn2blSwDIkzYljy9A4w7rFyc+rlqnPlJLS1ZH71oA8KmW9nFMTx3mT4azw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2016 00:20:05.7571 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR0601MB1452 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1237 Lines: 35 Hi Stephen > > @@ -111,14 +112,13 @@ int asoc_simple_card_parse_clk(struct device_node *node, > > * or "system-clock-frequency = " > > * or device's module clock. > > */ > > - clk = of_clk_get(node, 0); > > + clk = devm_get_clk_from_child(dev, node, NULL); > > if (!IS_ERR(clk)) { > > simple_dai->sysclk = clk_get_rate(clk); > > - simple_dai->clk = clk; > > } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) { > > simple_dai->sysclk = val; > > } else { > > - clk = of_clk_get(dai_of_node, 0); > > + clk = devm_get_clk_from_child(dev, dai_of_node, NULL); > > > I was confused for a minute about how the second of_clk_get() > call with the dai_link node could work. Is that documented > anywhere or used by anyone? It seems like it's at least another > child node of the sound node (which is dev here) so it seems ok. Documentation/devicetree/bindings/sound/simple-card.txt explains 1st of_clk_get will be used as "if needed", 2nd of_clk_get will be used as "not needed pattern". 1st pattern will use specific clock, 2nd pattern will use "cpu" or "codec" clock. 2nd one was added by someone (I forgot), and many driver is based on this feature. Best regards --- Kuninori Morimoto