From patchwork Mon Aug 21 08:05:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 110504 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp959034qge; Mon, 21 Aug 2017 01:05:56 -0700 (PDT) X-Received: by 10.84.151.3 with SMTP id i3mr18201998pli.377.1503302756763; Mon, 21 Aug 2017 01:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503302756; cv=none; d=google.com; s=arc-20160816; b=Yf4885+vLQVXcJ8GpetqkQZ0JK2lsVKO7k9ky3uE9OMPy3jnXChOjQsSL8zJ3iEkDz YkRoyndrtNonHb+ysJqCwszo/kbbWv5kQXzoeUD292c94FjchzH3SbAiM8doy+qslZyL Op7ALxUuKEoWwvmiuWVyf+iQpf7yw7M0T8BYRFohB65bH62F3vOE1CsBTxGJO/1rQn7X 1cV5wifs6KrkuLdbExOFDXfyZ11Xl6nx6y55GUgzuqLmCRFT43sfLSkY3fANIzlecMeN qGewOCroSc0lemUUIi61nMVHPRtMqKsSYCDRTpcx8c3YR/AhN+s91VFjQdF8f3lp2UIx PqGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=Qh1K3442/kWCuAFWUj2rMHR1lDpQeloV1Uatnaj8uTk=; b=BCNxWG4pNiJYhsTyFmYNr3xZYj53Y3mTZ9CtdoxZP1qH/ONE+daXHD/XCKVd9FVXDj 01M8/HmEBYrQCy++NXnjyetsPHVoDPFNcz94IRObxkOpTqQMr9bFFHFTM8fXo9LNf9D/ 3RrWvJ/6NdaRl7qmQeQCuiM8EUSPmSwvp7FlPL17RY1hqpV3fyjKRUeoBvLr4XNLml72 LCQ2v7fIcXpY4ZpzY42lBwb8coRmswjIhSNUAOMiw8JLP61l58zc8DP586WgxKE+F9WG 9jiufpHRdADCt65C3HOeW208/kHWDoSqDHCtk+DUfVCGMH9PbF/4o5DQxJV624Vu2uQh i2bA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 38si8019515plc.179.2017.08.21.01.05.56; Mon, 21 Aug 2017 01:05:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752141AbdHUIFy (ORCPT + 12 others); Mon, 21 Aug 2017 04:05:54 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:56945 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751923AbdHUIFn (ORCPT ); Mon, 21 Aug 2017 04:05:43 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20170821080541euoutp01ce7937b931fcc3af08d75bf223535c48~czeD6r3Bv2331623316euoutp01o; Mon, 21 Aug 2017 08:05:41 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170821080541eucas1p1625d7fd5b2f6abd53cfed573aa8d5eaf~czeDNiica0789107891eucas1p1k; Mon, 21 Aug 2017 08:05:41 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 3E.B9.12907.4549A995; Mon, 21 Aug 2017 09:05:40 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170821080540eucas1p25bd0c482fdb581bca68bc875bdfedc87~czeClqWC81148811488eucas1p2X; Mon, 21 Aug 2017 08:05:40 +0000 (GMT) X-AuditID: cbfec7f1-f793a6d00000326b-dd-599a9454c4a9 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BF.B4.20118.4549A995; Mon, 21 Aug 2017 09:05:40 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OV0009QWZT303A0@eusync1.samsung.com>; Mon, 21 Aug 2017 09:05:40 +0100 (BST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marek Szyprowski , Stephen Boyd , Michael Turquette , Ulf Hansson , Sylwester Nawrocki , Chanwoo Choi , Inki Dae , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v9 4/5] clk: samsung: exynos-audss: Use local variable for controller's device Date: Mon, 21 Aug 2017 10:05:02 +0200 Message-id: <1503302703-13801-5-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1503302703-13801-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrAIsWRmVeSWpSXmKPExsWy7djP87ohU2ZFGhyZrW+xccZ6VovrX56z Wky6P4HF4vz5DewWmx5fY7X42HOP1eJz7xFGixnn9zFZrD1yl93i4ilXi8Nv2lktfpzpZrE4 vjbcgdfj/Y1Wdo/Lfb1MHptWdbJ53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+vnmQou y1XM/nSZqYFxpWQXIyeHhICJxLypd9khbDGJC/fWs3UxcnEICSxhlJjePYsVwmlikjh55Qob SBWbgKFE19susCoRgSZGiSd909hBHGaBNmaJ/x1fGUGqhAUSJD4tXQfWwSKgKvHn8wmwHbwC HhIHJkxlgdgnJ3Hy2GRWEJtTwFNi34yNYLYQUM3tjhuMExh5FzAyrGIUSS0tzk3PLTbSK07M LS7NS9dLzs/dxAiMjW3Hfm7Zwdj1LvgQowAHoxIP7438WZFCrIllxZW5hxglOJiVRHj5psyM FOJNSaysSi3Kjy8qzUktPsRoCnTURGYp0eR8YNzmlcQbmhiaWxoaGVtYmBsZKYnzql9uihQS SE8sSc1OTS1ILYLpY+LglGpgPCLDvrSj2nZ57ZFQjceCNSYW/KJTzaYGX8n6wH3kgEFIx6mc pWGlEj639X5vaWjv1+04tGoJz8TK/RXrp2+QF7vj6Ph6e0nN33/XRcKnNoRO5XucJ7V2X2mh 49fF6RH1vZtCMtqUN7junysnE7/QQKpPWrtSt85/ruNGv9Unjlz4qbl1g/ctJZbijERDLeai 4kQAiC863qMCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170821080540eucas1p25bd0c482fdb581bca68bc875bdfedc87 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-CMS-RootMailID: 20170821080540eucas1p25bd0c482fdb581bca68bc875bdfedc87 X-RootMTR: 20170821080540eucas1p25bd0c482fdb581bca68bc875bdfedc87 References: <1503302703-13801-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Store pointer to the controller's device in local variable to avoid extracting it from platform device in each call. This will also simplify code in the future, when runtime PM support is added. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi --- drivers/clk/samsung/clk-exynos-audss.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) -- 1.9.1 diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c index 1fab56f396d4..6be52fb46ff3 100644 --- a/drivers/clk/samsung/clk-exynos-audss.c +++ b/drivers/clk/samsung/clk-exynos-audss.c @@ -135,6 +135,7 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) const struct exynos_audss_clk_drvdata *variant; struct clk_hw **clk_table; struct resource *res; + struct device *dev = &pdev->dev; int i, ret = 0; variant = of_device_get_match_data(&pdev->dev); @@ -142,15 +143,15 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) return -EINVAL; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - reg_base = devm_ioremap_resource(&pdev->dev, res); + reg_base = devm_ioremap_resource(dev, res); if (IS_ERR(reg_base)) { - dev_err(&pdev->dev, "failed to map audss registers\n"); + dev_err(dev, "failed to map audss registers\n"); return PTR_ERR(reg_base); } epll = ERR_PTR(-ENODEV); - clk_data = devm_kzalloc(&pdev->dev, + clk_data = devm_kzalloc(dev, sizeof(*clk_data) + sizeof(*clk_data->hws) * EXYNOS_AUDSS_MAX_CLKS, GFP_KERNEL); @@ -160,8 +161,8 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) clk_data->num = variant->num_clks; clk_table = clk_data->hws; - pll_ref = devm_clk_get(&pdev->dev, "pll_ref"); - pll_in = devm_clk_get(&pdev->dev, "pll_in"); + pll_ref = devm_clk_get(dev, "pll_ref"); + pll_in = devm_clk_get(dev, "pll_in"); if (!IS_ERR(pll_ref)) mout_audss_p[0] = __clk_get_name(pll_ref); if (!IS_ERR(pll_in)) { @@ -172,7 +173,7 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) ret = clk_prepare_enable(epll); if (ret) { - dev_err(&pdev->dev, + dev_err(dev, "failed to prepare the epll clock\n"); return ret; } @@ -183,8 +184,8 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) CLK_SET_RATE_NO_REPARENT, reg_base + ASS_CLK_SRC, 0, 1, 0, &lock); - cdclk = devm_clk_get(&pdev->dev, "cdclk"); - sclk_audio = devm_clk_get(&pdev->dev, "sclk_audio"); + cdclk = devm_clk_get(dev, "cdclk"); + sclk_audio = devm_clk_get(dev, "sclk_audio"); if (!IS_ERR(cdclk)) mout_i2s_p[1] = __clk_get_name(cdclk); if (!IS_ERR(sclk_audio)) @@ -222,7 +223,7 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) "sclk_pcm", CLK_SET_RATE_PARENT, reg_base + ASS_CLK_GATE, 4, 0, &lock); - sclk_pcm_in = devm_clk_get(&pdev->dev, "sclk_pcm_in"); + sclk_pcm_in = devm_clk_get(dev, "sclk_pcm_in"); if (!IS_ERR(sclk_pcm_in)) sclk_pcm_p = __clk_get_name(sclk_pcm_in); clk_table[EXYNOS_SCLK_PCM] = clk_hw_register_gate(NULL, "sclk_pcm", @@ -237,16 +238,16 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) for (i = 0; i < clk_data->num; i++) { if (IS_ERR(clk_table[i])) { - dev_err(&pdev->dev, "failed to register clock %d\n", i); + dev_err(dev, "failed to register clock %d\n", i); ret = PTR_ERR(clk_table[i]); goto unregister; } } - ret = of_clk_add_hw_provider(pdev->dev.of_node, of_clk_hw_onecell_get, + ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get, clk_data); if (ret) { - dev_err(&pdev->dev, "failed to add clock provider\n"); + dev_err(dev, "failed to add clock provider\n"); goto unregister; }