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: 9890291 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D619A60363 for ; Wed, 9 Aug 2017 10:36:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E69A7289BB for ; Wed, 9 Aug 2017 10:36:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB1B128A49; Wed, 9 Aug 2017 10:36:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 701E2289BB for ; Wed, 9 Aug 2017 10:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-reply-to:Message-id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=eJnWG16LuHeflySTpgf+tFuEGoIAn79/EiLsVKGE+0E=; b=S/1jywLF5aJv1w3ZXaeNyza1px CGKVTweKpg3MS5Dp0HssAuFZsCjFyZwgOTXhU6GM5dZ0KJ+MJ1O55A48NWlk+7HezXhMgGnY0ArJ6 0gGnN7cy4zaEl5ybw1ApThFjkpjxaeHQxjdNEK8RdokwZv4RdUd5xFM6AK/rok5LCxittuGxMqyfZ 0v6NLVcewQgqlPUTXboH1Ng9wrtrVfkP2+rV0/0OPhZ5u8a3+P4BgXhJ/UKJVGW+tq2qKH75kZ8xN Rhi1N4jSph12J1X+H5QL6ukfCBBQoiqT+dUVTKsJSi+K8fY0vSrB3+x6m9u2ycFYDY1lOXO6A5qCx eJ6P2hlA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dfOLK-0000Hv-Nn; Wed, 09 Aug 2017 10:36:02 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dfOL0-0008TZ-Qi for linux-arm-kernel@lists.infradead.org; Wed, 09 Aug 2017 10:35:45 +0000 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> for linux-arm-kernel@lists.infradead.org; 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 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 JzOy8zh1NquSCcV4l23LGZb8Xac82dogpjvqzQQ9tT5P0MbPBpx2udpFtOXrJEGv6mcJeq1q ENH1rl4B3Tb4SUSPOeLogcUHBL05UonT9rYb5yTMynSpiHlfXSVgLKYKITMz2SNk3jQXMdWd JsSsWYKuiBLFZ1M4VYaWU5+IThKnG8o78NzFwLv6V2asGI2ADpEkUArYMMTpkNcOHoDRWbNQ h8SklGpB8GHTIXAPpNQaggVnMC8pYHrIRfDSSwTd4zW7j2IBNFu3kdsSUuGgW9J5onypEgS1 7WaPhVElGDzsrfXk+l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pwMCuJ8D5/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?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170809103514eucas1p11fb5d1af243e882a5d51a25956d24a19 X-RootMTR: 20170809103514eucas1p11fb5d1af243e882a5d51a25956d24a19 References: <1502274907-11931-1-git-send-email-m.szyprowski@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170809_033543_022531_0D4DCB52 X-CRM114-Status: GOOD ( 15.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , Bartlomiej Zolnierkiewicz , Michael Turquette , Stephen Boyd , Krzysztof Kozlowski , Inki Dae , Chanwoo Choi , Sylwester Nawrocki , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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; }