Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752360AbcKPFR1 (ORCPT ); Wed, 16 Nov 2016 00:17:27 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:51874 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750867AbcKPFRW (ORCPT ); Wed, 16 Nov 2016 00:17:22 -0500 X-IronPort-AV: E=Sophos;i="5.31,646,1473087600"; d="scan'";a="225490190" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <8737isvwc6.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Michael Turquette , Rob Herring , Russell King CC: Mark Brown , Linux-ALSA , Linux-DT , Linux-Kernel , , Linux-ARM Subject: Re: [alsa-devel] [PATCH v2] clkdev: add devm_of_clk_get() In-Reply-To: <878twndi54.wl%kuninori.morimoto.gx@renesas.com> References: <87wpl2yyuw.wl%kuninori.morimoto.gx@renesas.com> <146785219147.73491.2827268663638530377@resonance> <87ziptixv7.wl%kuninori.morimoto.gx@renesas.com> <20160707122636.GP1041@n2100.armlinux.org.uk> <8760shgfzu.wl%kuninori.morimoto.gx@renesas.com> <146794140875.73491.7115209079607438738@resonance> <871t34hlin.wl%kuninori.morimoto.gx@renesas.com> <878twndi54.wl%kuninori.morimoto.gx@renesas.com> 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: Wed, 16 Nov 2016 05:17:11 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OSXPR01CA0062.jpnprd01.prod.outlook.com (10.167.144.41) To KL1PR0601MB1448.apcprd06.prod.outlook.com (10.169.69.26) X-Microsoft-Exchange-Diagnostics: 1;KL1PR0601MB1448;2:Zqi4wzj7TONrDO5+/1/e7iT+yOWVwGxPnU6r8cts6/zxGFIXeM4N7jM8Smelfg9VGA1EBhocw2XE0mtSWb2dywSgP2ql/y8nm9KsP6sspzN2a3J3PZ3C9CpwBZ3XShOCRrbsH1HWz8iyZ/091TwmfXrhxxarZjpAT1RIEoODxyE=;3:qmQjxelteJg/YVxI8dhXnjkD3hMEJlWpRMB/bxh/fuxhSa5Y2r7AsoP+eTVH/lCXy1/qvmEeCN2jJCYREgZaeN0h574s0f9nAxgfHqhxVefgtPlY/UdBPWrCvvuu9lfd/MEOyj1uZaGDBBbXtqSa+TsQljpFqHP8GhXn+0FrOZk= X-MS-Office365-Filtering-Correlation-Id: 71c698ea-1c55-497d-e4bf-08d40ddfd257 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:KL1PR0601MB1448; X-Microsoft-Exchange-Diagnostics: 1;KL1PR0601MB1448;25:pYIzzl044JW01kvrHXuHOaOx92nbogDO+nxj79b9gtTC3OaAKzSUcM+njx9mRPjE+Z+kVWgBq6sRfjUIopLOrl0613sCyMhao1tGpS/SdNON2BnEfhvgdwo9uIXaCDtSIY7KS4lNX27aAKspUekZHWIP8SVUT4+RA4asER/liO+dhbsfCwAO0dJIpXm7/JcAYX3HjsYu76BM0UzPcEACV2Ec9aMG8GP/MgdJXv3OWiHtBGRMI3OMP+izDYaVaftdC85+rDkRWjc17+3bZabmXPbNYTrsh89vyHAsCoZguLYueYDJ7+TdpegLKqXMKdIs9gEZJgRhVev9b+YjbHTUOeq6ZNXa9WEiM+uz0054RJL+cjfEtx12Zj760kDUDTWfoVPv3c5Znyfcmupp25g/Q+QbZrKA7jfZC3MLvcw4x3CbBr53WYfcrJSfajE8bs64vM77JvcmjphYon8K/gaYiKDlCzE68+QdyCk+mk4SUrw9UF2HFFAK+ZAxVvj1nfn3nXt+1lraKiFb3i05yktniWxzLml3Pno0byvHlrd4HIH9xBNYsCT6RVgUKfGArUzPNuC6DTqbl/wCk9yZNhx3bxxgLvp+gYnMGp0zrz4U4g5k/0Cw0i768bz/rbmCujFQoFJPYJnjZWkgrf6tG8mOg1Y1lbTrMptQsksmPjVsvF71twftAomPm5ySvTce2ga3gg99EjXglyR40tvXZIcZ223oPwgJBPT1jX+0tg9BJHW8ED19MBOg9aI80IySlzBo X-Microsoft-Exchange-Diagnostics: 1;KL1PR0601MB1448;31:khlmn85u7WF3dd9NNBx+jzLcfybyEgSCr2UYTViuEATxs32GF4LlRuXCTxT600Suq4S4Vr0XcIPcoeKG3W8PWOFi2OhndTDCbHjd4whrUN22rQpW0hUGZX5ltBAHLlK1/iAlL9VtaDIcn+2Y52jOlt8awMP4oNFER9JHV/Ah9yM2dVAoskQVxZ/HIGrmCe7+l8hnMB4csfdpbAAhBKxKgFp//gaYLPURfkwYUITzHYVfkbGo4UINNoWTEkvf3o1mnS54Nh+RV6eHA0TrJ7jNpA==;20:n6qbBpWeGMyiQM5eGYe15VLni1/5Ecw5nNfr859tR95028gPdFt4oq/H0BjDQnWgXc1T1mT25q5B9X3tsWt8A2v7BVwQWEyKHsvAtWiKeLEb83KQDYNZLcZ5jizjkMPS1C9Kqmrwvo4qDRSoF0BuArr10pipLfk3g82SpvJXPeqq0kIO71oMo9XApp5jPJl3LusmdeHObdff9zXJMiHT1PxPX1CApABWw4wd3wXigVq3F6cO0WQlusCzftmE48F1OysvpX1d5b/BSmUMkpB+Jh8qKq8BFvFir510P4KoLZ44oPsOW8fqbRfwTRI1+nlWTJMWMOOq2PX5sfUyQ9MW+HTlxVG2bCflgNExH+oUTgM3haiRJVeOcpu4rArcr42kt3xT48NTsU7FAXcC8+Sa/mlks1J0NIZ59CSGp2znOv9sHK70STReyxrHNdWpgt4M1+Pst8Jyxi2UCBTyRxaglUjdQQnN9Z9zXKdrBMdLP7hhDXev1w0ri3aKN1jyb1yA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6060326)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6061324);SRVR:KL1PR0601MB1448;BCL:0;PCL:0;RULEID:;SRVR:KL1PR0601MB1448; X-Microsoft-Exchange-Diagnostics: 1;KL1PR0601MB1448;4:fW2UmKGHJFBtEH6RJKnq+bLYrpcAWZmPykToNvCYLMyVG4Vai2h6m9r/8/8mduhgpGePUqp6Wd48LpmRXdOsidMF56VG5g2Syzx5suu/swklhv8xUVsArtUYTfrSy842V7aXrk0ifcQq7ncCvyS4CwrxWM/ShCnv8Ulk/2tJayG9ApNQAdifnT1Obzr5A/iWKJfWSdL5OEWYueLxLq7WpHJFVg486rdnyBYv2SB9vRE5tVFDFjvE79qpMYpBo90UClnoyOXfTB6HcKjWBKnRx+E00KDMfF6VQedFJPAfuaoWdUrsg1LRE6MLUnW9Yto1LUiZTu5LFOnHgv9aUVnyR5cEnLFhuv6QNDFCkDr9jPgP6Zw8rGJNd2TuWa02bTja+PmpLYe3L50B6zWFqh3+dcLfJ5Pv5NP3E1bC2kB57f95ZQT2J+ZBJRHto8yd/DWL X-Forefront-PRVS: 01283822F8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(68736007)(3846002)(6116002)(36756003)(86362001)(23726003)(46406003)(5660300001)(66066001)(53416004)(4326007)(33646002)(69596002)(189998001)(76176999)(83506001)(106356001)(2906002)(50466002)(77096005)(47776003)(105586002)(8676002)(93886004)(42186005)(305945005)(5001770100001)(101416001)(7736002)(50986999)(97736004)(7846002)(54356999)(81166006)(345774005)(229853002)(4001350100001)(92566002)(81156014)(2950100002)(21314002)(16060500001);DIR:OUT;SFP:1102;SCL:1;SRVR:KL1PR0601MB1448;H:morimoto-PC.renesas.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;KL1PR0601MB1448;23:qPprt9Ta0oNTVHW/kcofkQoTiP2gvfqzaNcF3KO?= =?us-ascii?Q?IszTQrbRzmIUHdP2HhE8bVsY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ugXLutKQLruWUPkq3vUhivTSjspyZDE3X/mRAdRvVI4RHsV/UvMrk?= =?us-ascii?Q?jBqXKh/Z6DJ477xr5VXp3+F08hPB8OcNf8jpttFlu02v/j1vJqOTOorzpy/M?= =?us-ascii?Q?UPFLK7HCvQpzzv8k6lFaIvDDf/b0Xc/dQaEMxrikZA8AKbSDECTmM11ihQkd?= =?us-ascii?Q?zzqmDd6Rb/g8vWdygE2uoa8rzmdHlBiSHA8kxHfIn/4y1coCKPbSP/z/moCJ?= =?us-ascii?Q?EU5rICBKvE/Dxj8ceQ21TDN6CNljOBmWIpetU?= X-Microsoft-Exchange-Diagnostics: 1;KL1PR0601MB1448;6:wmA3iE9G+QkqLS0e1AYfkkX0nyLltjFoyZesc0J4EwceM6BW00SBMkPAVl7Grgm84q6wjI4cL+/W/5cZyacaucAPR2GOrtPflOsqCJoyVBj0UP/BZgNKO/V6iUWgyPG1ks9A6i4dfBbO/eo3+jUEoRIEevdQxp+lUjM6n6fpzAP6SwQPbTk2n4fZQS60+A2O6kJxwQjZSEIJudZLYt3+qMzdABjuvOkSfb0nam3vK914PRSdrRBzrSNIkNwctkGaR9NaQoto+x3KxGUQIPVz2fcmPEgxwk5IFfd9ITXPeAzFq9WrcKDVR7iy5hOpKzECWpD0i33N6kELv5uthFqX1CAikE52QwXJzzJKdskSc5N2w4tF726eHyoJBfYXb98z;5:zoQfe+qWQKcWYaaloM2b0PAxzQdt3dzIMh2nbXxkLtyydOs6Q0GHCopG2/x08aVVe4dRvYzggq0gsDLR/rSX2LL82RQcM9YiL1j2wwfaPZKVedWtdu5v9k/FmaLqbjnD1f7gFwoDlSh8EOvkYtPQ99dY7pXEmj/qa0R4OgOg3do=;24:UwkFOt7nkpkABgepsAIfS/Ird2ZGhum5oNe11wsxxTNzm9igAcLoeQBZW6BZaXFsRkcvFH0lxuU0Biq51+ZErr6L4pu5inhQG7Jjz8jwqGs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;KL1PR0601MB1448;7:MUPLb9w4D293KqyMQgIXuvU1mfD2sGW/FQyTdR0qKinOoMEVDrIahfeP0tP2V/owpYMaHcs3W/ynY+4pAKl547lFnY2ITiQtbJiaqsC8kA3ZRrJAc0QibaRYUdkUxm/Bx3CQa+5P59SgzB/AQE+ztXtadj7NibjEasNGfxzRwSTfFWkaOzKdlU2nxYfpBKOxXi4j1WtGGb9ud3dXYEjACypYYZbhLLDtKYs9cZkZaO3QM2Hn14u4ZtltUPKdo8JRqHvjKcep+qqtmRF0xo+57DHUm50KpCfD/vTQAnpKGQ1r09XzWJ5X/T0ZhM6g2u2XDoJ9JFZbOnpuuKgxTy2h5J8QeYGba63/1OfhFWurxPs=;20:1TcSDukFyxQT1EoQICVgDuLVtVgNB013daifjRGp0CfK/o12KN1+FU/j5SXQE4fLScwLkulgq751gqmttVErgBmjkiQw0WudYd8FXBOfvonn/cIfzE7JgKOCGFSFAxfwCQdfWyapgcunsi3MjH5Zf+f9/GO35t+lTlJE8N6BUMc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2016 05:17:11.2896 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB1448 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1396 Lines: 62 Hi Rob, Michael, Russell What is the conclusion of this patch ? We shouldn't add devm_of_clk_get() ? or can I continue ? The problem of current [devm_]clk_get() handles *dev only, but I need to get clocks from DT node, not dev sound_soc { ... cpu { ... => clocks = <&xxx>; }; codec { ... => clocks = <&xxx>; }; }; > > Thank you for your feedback > > > > > > struct clk *clk_get(struct device *dev, const char *con_id) > > > > { > > > > ... > > > > if (dev) { > > > > clk = __of_clk_get_by_name(dev->of_node, dev_id, con_id); > > > > ~~~~~~~~~~~~ > > > > ... > > > > } > > > > } > > > > > > > > I would like to select specific device_node. > > > > > > Do you have access to the struct device that you want to target? Can you > > > pass that device into either clk_get or devm_clk_get? > > > > If my understanding was correct, I think I can't. > > In below case, "sound_soc" has its *dev, but "cpu" and "codec" doesn't > > have *dev, it has node only. Thus, we are using of_clk_get() for these now. > > > > clk = of_clk_get(cpu, xxx); > > clk = of_clk_get(codec, xxx); > > > > sound_soc { > > ... > > cpu { > > ... > > => clocks = <&xxx>; > > }; > > codec { > > ... > > => clocks = <&xxx>; > > }; > > }; Best regards --- Kuninori Morimoto