From patchwork Wed Aug 9 10:35:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 109707 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp675972qge; Wed, 9 Aug 2017 03:35:33 -0700 (PDT) X-Received: by 10.84.141.131 with SMTP id 3mr8582739plv.224.1502274933009; Wed, 09 Aug 2017 03:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502274933; cv=none; d=google.com; s=arc-20160816; b=EKsBCQ+XKMSDTcIqUqk0XtegaYuodjQW/JoAY7nb0+G2Cf6yBTioMt9prh99egMl6X PSI7Z8YD/uf7hJv9og1hZc/n6w2IfIdTjYt7vg65B4PqNi+ZnCdvrvb2bqws3UcrmbWI AOoqJ9sj+427sA/J8sXkXmIEMK0L29XoXk6Xd1dv3uGGlHVgZszOUJE96pPHhGfO3JEh 5Ksv1CQWqRlUYq18sXT9fYZKXfifQ6LsbLwFQJquMIYhGvX9B3x6CoMGJF3vmhUJ//ir hTGbQLgyR9qMGoa8cFOf9J4lRC08GN8zQay2NKve4QlqgyQBAKcO8eyNga4jsW3zZz0X Fivg== 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=CvMwJ79qx3Pyrb4qTUD2UzCfqz6Rbh5NdkFTY4KFYU0=; b=qBgTvULXv8zPgHkPdhjwOttNMqe5C1MKA4QVLgLZPKSSOQ+bPhvAYkk00lQoJihLN3 QmI7cYF92DMPoB9D8xvCGjtyBe4SyUF9lAVRhq3tOwYqfIcD2lhtJzVxuHmM1t05unK0 WDl0TDGuTLvmI+SLcSth2ZbIoxFrMsVidBeJE++urnhuKoNTL3hZs/7MAlYiIoOKWrMQ xsv0OaSHRhzp2x+pOKrq3FC2bqvODC57a5Yw//fxY8lGhyYKAwlD0ZC1kAF8i5VlPFWK XskLSoHFkGdXpSUstGwSEVNneUAY5UhFqBd8FjXPwodFLrKCBdnqv7HKBpkFKccLRwhD Y5NQ== 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 s16si2577877plk.305.2017.08.09.03.35.32; Wed, 09 Aug 2017 03:35:32 -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 S1752271AbdHIKf1 (ORCPT + 12 others); Wed, 9 Aug 2017 06:35:27 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:20461 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752069AbdHIKfS (ORCPT ); Wed, 9 Aug 2017 06:35:18 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OUE00J6MYQRJU40@mailout3.w1.samsung.com>; Wed, 09 Aug 2017 11:35:16 +0100 (BST) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170809103515eucas1p1dc8f77fa6b3027d08f410e22ceca1127~ZJxOEMzy30529605296eucas1p1X; Wed, 9 Aug 2017 10:35:15 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 41.39.12944.365EA895; Wed, 9 Aug 2017 11:35:15 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170809103514eucas1p11fb5d1af243e882a5d51a25956d24a19~ZJxNSYt2J2580825808eucas1p1-; Wed, 9 Aug 2017 10:35:14 +0000 (GMT) X-AuditID: cbfec7f4-f79ab6d000003290-f1-598ae5637492 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id F9.65.18832.265EA895; Wed, 9 Aug 2017 11:35:14 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OUE00IH6YQKHB00@eusync2.samsung.com>; Wed, 09 Aug 2017 11:35:14 +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 v8 4/5] clk: samsung: exynos-audss: Use local variable for controller's device Date: Wed, 09 Aug 2017 12:35:06 +0200 Message-id: <1502274907-11931-5-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1502274907-11931-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSa0hTYRjHe3fO2Y7LxWlqPZn6YWhQ6UobdLCUJIVTSBewYvYhD3q85Lyw 6cr8oAmazqlzQhklaWnGwKZLJEE0p2w4ZVPyVpgZXSzxgimoCJXbsW+/931+/P888JCYdBn3 JzOy8z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owME5wD1YSd8uwS1jQsdGloI3 shU9K9YzNzCekehi5OSQEDCRuHHyPCuELSZx4d56ti5GLg4hgSWMEq8+vWWHcJqYJK4/ms0I UsUmYCjR9bYLrEpEoIlR4knfNLAqZoE2Zon/HV/BqoQFEiSO/3jODmKzCKhKvDi3BGwHr4CH xMsLD5gg9slJnDw2GSzOKeApsX7OLWYQWwio5t6xTSwTGHkXMDKsYhRJLS3OTc8tNtQrTswt Ls1L10vOz93ECIyNbcd+bt7BeGlj8CFGAQ5GJR7eG3s6I4VYE8uKK3MPMUpwMCuJ8D5/3BUp xJuSWFmVWpQfX1Sak1p8iNEU6KiJzFKiyfnAuM0riTc0MTS3NDQytrAwNzJSEudVv9wUKSSQ nliSmp2aWpBaBNPHxMEp1cCYxmt42E8m9eWmnoqpvbu9vBZEr7nn08gZxzdfZdfBZ1sT+hNP RTUeUmd4csRp28yZHSvOr6lOD5/sE+HHvl9q+/KXAYlNG2qFPeUiBO6pa3nNmzTv5CnbMPeS 5pZV3uc9Ntstk1m58+fC9v9z7RfbZypcvu8w+XZta6++rk+GfJXa7S8P9fqUWIozEg21mIuK EwG+PnMdowIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170809103514eucas1p11fb5d1af243e882a5d51a25956d24a19 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 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-HopCount: 7 X-CMS-RootMailID: 20170809103514eucas1p11fb5d1af243e882a5d51a25956d24a19 X-RootMTR: 20170809103514eucas1p11fb5d1af243e882a5d51a25956d24a19 References: <1502274907-11931-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 --- drivers/clk/samsung/clk-exynos-audss.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) -- 1.9.1 Reviewed-by: Chanwoo Choi 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; }