Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751547AbcLEFYC (ORCPT ); Mon, 5 Dec 2016 00:24:02 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:11684 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751204AbcLEFX4 (ORCPT ); Mon, 5 Dec 2016 00:23:56 -0500 X-IronPort-AV: E=Sophos;i="5.33,302,1477926000"; d="scan'208";a="227061721" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <871sxnvtkp.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/3] ASoC: simple-card: use devm_get_clk_from_child() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Russell King - ARM Linux , Stephen Boyd , Rob Herring , Linux-ALSA , Linux-DT , Michael Turquette , Linux-Kernel , Mark Brown , , Linux-ARM In-Reply-To: <874m2jvtmw.wl%kuninori.morimoto.gx@renesas.com> References: <874m2jvtmw.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="US-ASCII" Date: Mon, 5 Dec 2016 05:23:37 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0045.jpnprd01.prod.outlook.com (10.164.162.155) To PS1PR0601MB1451.apcprd06.prod.outlook.com (10.165.210.155) X-MS-Office365-Filtering-Correlation-Id: 63dab422-10b7-4034-69b4-08d41ccede2c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:PS1PR0601MB1451; X-Microsoft-Exchange-Diagnostics: 1;PS1PR0601MB1451;3:yzyOX5BspY6sdf+HPoglgHylDony8giV7dpR2pOfVYprsleHoxZWNLv3RQuyGPG/8VVyuptvPb76m10wNaFBJPY3n1bZEiB0DjMaUSgD4AeGfqYEpleqrhZA3oDBnxT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lbt7YxdjIAkxmyZTBgUGaSVLwmG3kjTUf1NPvu01DWnPqs1eAyBpoZRZtQH5TTr74wmPdmH+bQnPjX2oAQQqyj5OIg6SkO4qg8wl1T+aIxQchF0YiuSR76AFf1b5112Nro3YYKnGpGU2s+bo0uC3OLXEJ8QPS4I5YNT9yfhkkbPXJCVJM5VLHB5wNzoIg0FGV2tNyRPM3FLjFSOvVN4gYidSyfh+yzkIHxWLC2F2Idj/1EaVZYQC3j4p;20:zrLuiI1z2ZiwItqpH+lU68gAtS4okBFbvYmjZvZxyMFqn2k65no/RhYvJxhS+LwgkRACQ629d0ZcWft/2w5gKB1CeVi9VG2ejOtFLleadoFJUvc6LPANCnDZ16W6O79Uy3PpijEtjhCiKNigcOZ5fVLoP8Jw0K9+ZIlJQ5DSCaSRNB52dir7ho8Lbh1QgrrdB/t35RIuA8IXBRm05zsdq0x1/xbpTllSpLYxnRBTegyXhm2UlDroD8Mnr9t8OeTmyx7Z9ruhMyM5uOQ+FnQwewbetHKp3Souq1VcOxva6EDmJYQsdkUyJH4LV0U4rvw3RO1MnEqKhRrLzIj6tLfpCbdks9AlIIqUzneWLbqTr2wxxcPv/1chX4OMLQLXmb3xL8fqLOj9hCTpk+wy2SQQy661YFb3jE0SxYUBYdIUTZduRUN3o6TW3+9h2Qa45fAh1lpE3HA8IssvlR1ekpInQbXAHUBLSgaSGwzGzVL4hZEYkmYFP3DN0qIVayvuyjfK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123555025)(20161123558021)(20161123564025)(20161123562025)(6072148);SRVR:PS1PR0601MB1451;BCL:0;PCL:0;RULEID:;SRVR:PS1PR0601MB1451; X-Microsoft-Exchange-Diagnostics: 1;PS1PR0601MB1451;4:zYZRIir1w/ZLSOc8nV6gXGzLHdjjFZz9uI2QV8RPhvss5NbrUrZrageMVMaOPKLZ7QlAR6AbM7WsZMqNqk9xem9X9nCbekQvO9H+q41kc4qfSH1p0tVKtK8qwJRjtJEz/ymMjilPCuDz9gCYRRiDnXMo8d5MxUUSHJvcHet2t0smnOT+PPd/ZjyOrYZM4cFDLlM6PqX0JYy6joVpScwALFy82Qh3dKQ2+aNZHk3wUF1QMVZdil/5xK8pmhHCdyANnew/8UtUQOfn1qnmMZsWs8a6QHfkpoUG+PfrtMC89m6U7e9uLn8MP9p7J9h1pwPHZaHTnxa782+IlD897nc67jUdKGR2AD0fIZ0pQBmyaDRJr9vOlbMjCxzPwsHSFFbtMe54nNCKlL64VVxjMfdpT1EYaKYxdRBEuC9p5mOLtjMVuINS3h90QxjYKhCUFlxiHNq6prxzLAi1RH5jUJJjaQMURZ686+8qtAuGPRw2nU2FleruCJ6McR3d4MbwAr8S2aMirou//VFtf1WRa9BNkGEu0Jt0mzhvMrFbv5I0Edgp67ovI8z1CRylWN3cWOId3K6FV7Yb+OQ5FfLxe+d4qZkSUHwBL6wnPXsfrAxjthW8sDX6zBsMe8OKrLKwemMN X-Forefront-PRVS: 0147E151B5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(107886002)(6486002)(83506001)(3846002)(81166006)(106356001)(101416001)(53416004)(42186005)(7416002)(36756003)(7736002)(92566002)(86362001)(50986999)(68736007)(46406003)(39850400001)(54356999)(47776003)(39410400001)(76176999)(69596002)(2950100002)(105586002)(6116002)(733004)(23726003)(8676002)(305945005)(38730400001)(33646002)(2906002)(7846002)(81156014)(5660300001)(66066001)(50466002)(4001350100001)(5001770100001)(189998001)(39450400002)(97736004)(39840400001)(39860400001)(921003)(21314002)(16060500001)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:PS1PR0601MB1451;H:morimoto-PC.renesas.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us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buMYOyzYgJRUb0UVX8LC8sFymMXZSTSi5gtXAz0RMFON1EkVce7Hqinz3tMweH;5:3VrYWloJgD/mz3y1Yw1Gu35JD+W6xXlrsAw7JBRExeeK+lAVbeOhHGcz6+hKclF3kEZhFeXmXR89lIyQioDdZ/kY5bo/zMIQsifUgPB8mT2ruvMbzcg5g67YLUxD6NdDjLd7L3akFnvg7qYpTh35aA==;24:3biQUEQi7Da0YlrljGSWJr+DgNpfzKSTvmwIXieE+hcKv2urvZzG+K3htm5RizvnlqB9kZ3qDGBv/gHXBC8eebrHQrU/X/d5Prwzb/EkFws= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;PS1PR0601MB1451;7:XnWuo2hLmDN6G/5Wn7p7aqygbX+2uGhbYFpzRKwKWzzjJLgRS50OG96GsIiTDrv9KolC6T/RO3DTcteajDVj0LDCL+lTwQfotLDGQjdEWflLYEz9QiH6y/OIvFXsx8kQ1BCIqKw9RJXwDXdhieFDf41R7Zbu67dYUJsWd2X90ALQlxvFBss11l3nrybxDvpin9VD1kNviKMGiVEleJn7d9HBN+2NSeWNqx872yC8lu034pU/HQZwx9DL9OZmGBSOzHClYW2WLwnbqXIH5/SnfDWwzYjXgU6PkXK8s4LVphKvhNSmzGKr7bYQh+2GHTzEWSZKn2KzDjwZJrOIV6GxhS2nqauBv83HuJDnwP4ku5JnYBS5Vjx4aarmPtTuwCAQBebL5N8oWCmrgfyGz4rPAlqlW/Gwd2qzu93wNsNQUE7rPbTptNAce2g3Ae8Fwx25qLno850X/A8vJfavomnjuQ==;20:VaitqPZ9V6y50FiHR0Zq7JWZiIHfe/afHNTXKUvDtsRW1Hq6qUrsi+7PH/dFZ66RUfEFdC8OLchrEXZ/EVsT6DPjifeLZojmE75ejSMgrzI0xBgho2rwHiHHDmYHWbJAFJ6OBbkzUohAOhNIC471Kd5N/42rHVlOZ1iTcXZoH6Q= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2016 05:23:37.5709 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR0601MB1451 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4414 Lines: 110 From: Kuninori Morimoto Current simple-card-utils is getting clk by of_clk_get(), but didn't call clk_free(). Now we can use devm_get_clk_from_child() for this purpose. Let's use it. Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_utils.h | 11 ++++++----- sound/soc/generic/simple-card-utils.c | 8 ++++---- sound/soc/generic/simple-card.c | 4 ++-- sound/soc/generic/simple-scu-card.c | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 64e90ca..af58d23 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -34,11 +34,12 @@ int asoc_simple_card_set_dailink_name(struct device *dev, int asoc_simple_card_parse_card_name(struct snd_soc_card *card, char *prefix); -#define asoc_simple_card_parse_clk_cpu(node, dai_link, simple_dai) \ - asoc_simple_card_parse_clk(node, dai_link->cpu_of_node, simple_dai) -#define asoc_simple_card_parse_clk_codec(node, dai_link, simple_dai) \ - asoc_simple_card_parse_clk(node, dai_link->codec_of_node, simple_dai) -int asoc_simple_card_parse_clk(struct device_node *node, +#define asoc_simple_card_parse_clk_cpu(dev, node, dai_link, simple_dai) \ + asoc_simple_card_parse_clk(dev, node, dai_link->cpu_of_node, simple_dai) +#define asoc_simple_card_parse_clk_codec(dev, node, dai_link, simple_dai) \ + asoc_simple_card_parse_clk(dev, node, dai_link->codec_of_node, simple_dai) +int asoc_simple_card_parse_clk(struct device *dev, + struct device_node *node, struct device_node *dai_of_node, struct asoc_simple_dai *simple_dai); diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index cf02625..4924575 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -98,7 +98,8 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name); -int asoc_simple_card_parse_clk(struct device_node *node, +int asoc_simple_card_parse_clk(struct device *dev, + struct device_node *node, struct device_node *dai_of_node, struct asoc_simple_dai *simple_dai) { @@ -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); if (!IS_ERR(clk)) simple_dai->sysclk = clk_get_rate(clk); } diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index a385ff6..85b4f18 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -278,11 +278,11 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, if (ret < 0) goto dai_link_of_err; - ret = asoc_simple_card_parse_clk_cpu(cpu, dai_link, cpu_dai); + ret = asoc_simple_card_parse_clk_cpu(dev, cpu, dai_link, cpu_dai); if (ret < 0) goto dai_link_of_err; - ret = asoc_simple_card_parse_clk_codec(codec, dai_link, codec_dai); + ret = asoc_simple_card_parse_clk_codec(dev, codec, dai_link, codec_dai); if (ret < 0) goto dai_link_of_err; diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c index bb86ee0..308ff4c 100644 --- a/sound/soc/generic/simple-scu-card.c +++ b/sound/soc/generic/simple-scu-card.c @@ -128,7 +128,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *np, if (ret) return ret; - ret = asoc_simple_card_parse_clk_cpu(np, dai_link, dai_props); + ret = asoc_simple_card_parse_clk_cpu(dev, np, dai_link, dai_props); if (ret < 0) return ret; @@ -153,7 +153,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *np, if (ret < 0) return ret; - ret = asoc_simple_card_parse_clk_codec(np, dai_link, dai_props); + ret = asoc_simple_card_parse_clk_codec(dev, np, dai_link, dai_props); if (ret < 0) return ret; -- 1.9.1