All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Sylwester Nawrocki <snawrocki@kernel.org>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: [PATCH 06/10] clk: samsung: s5pv210: Use generic helper for handling suspend/resume
Date: Wed, 29 Aug 2018 17:50:42 +0200	[thread overview]
Message-ID: <20180829155046.29359-7-m.szyprowski@samsung.com> (raw)
In-Reply-To: <20180829155046.29359-1-m.szyprowski@samsung.com>

Replace common suspend/resume handling code by generic helper.
No functional change.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/clk/samsung/clk-s5pv210.c | 41 ++-----------------------------
 1 file changed, 2 insertions(+), 39 deletions(-)

diff --git a/drivers/clk/samsung/clk-s5pv210.c b/drivers/clk/samsung/clk-s5pv210.c
index fd2725710a6f..41d2337fe030 100644
--- a/drivers/clk/samsung/clk-s5pv210.c
+++ b/drivers/clk/samsung/clk-s5pv210.c
@@ -14,7 +14,6 @@
 #include <linux/clk-provider.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/syscore_ops.h>
 
 #include "clk.h"
 #include "clk-pll.h"
@@ -83,9 +82,6 @@ enum {
 
 static void __iomem *reg_base;
 
-#ifdef CONFIG_PM_SLEEP
-static struct samsung_clk_reg_dump *s5pv210_clk_dump;
-
 /* List of registers that need to be preserved across suspend/resume. */
 static unsigned long s5pv210_clk_regs[] __initdata = {
 	CLK_SRC0,
@@ -132,40 +128,6 @@ static unsigned long s5pv210_clk_regs[] __initdata = {
 	CLK_OUT,
 };
 
-static int s5pv210_clk_suspend(void)
-{
-	samsung_clk_save(reg_base, s5pv210_clk_dump,
-				ARRAY_SIZE(s5pv210_clk_regs));
-	return 0;
-}
-
-static void s5pv210_clk_resume(void)
-{
-	samsung_clk_restore(reg_base, s5pv210_clk_dump,
-				ARRAY_SIZE(s5pv210_clk_regs));
-}
-
-static struct syscore_ops s5pv210_clk_syscore_ops = {
-	.suspend = s5pv210_clk_suspend,
-	.resume = s5pv210_clk_resume,
-};
-
-static void s5pv210_clk_sleep_init(void)
-{
-	s5pv210_clk_dump =
-		samsung_clk_alloc_reg_dump(s5pv210_clk_regs,
-					   ARRAY_SIZE(s5pv210_clk_regs));
-	if (!s5pv210_clk_dump) {
-		pr_warn("%s: Failed to allocate sleep save data\n", __func__);
-		return;
-	}
-
-	register_syscore_ops(&s5pv210_clk_syscore_ops);
-}
-#else
-static inline void s5pv210_clk_sleep_init(void) { }
-#endif
-
 /* Mux parent lists. */
 static const char *const fin_pll_p[] __initconst = {
 	"xxti",
@@ -822,7 +784,8 @@ static void __init __s5pv210_clk_init(struct device_node *np,
 	samsung_clk_register_alias(ctx, s5pv210_aliases,
 						ARRAY_SIZE(s5pv210_aliases));
 
-	s5pv210_clk_sleep_init();
+	samsung_clk_sleep_init(reg_base, s5pv210_clk_regs,
+			       ARRAY_SIZE(s5pv210_clk_regs));
 
 	samsung_clk_of_add_provider(np, ctx);
 
-- 
2.17.1

  parent reply	other threads:[~2018-08-29 19:48 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180829155058eucas1p1db74951957e2d911ba91ddcc07df52ac@eucas1p1.samsung.com>
2018-08-29 15:50 ` [PATCH 00/10] Cleanup suspend/resume code in Samsung clock drivers Marek Szyprowski
     [not found]   ` <CGME20180829155059eucas1p28a20924521edaa4c9bd3d9683d0f2d0d@eucas1p2.samsung.com>
2018-08-29 15:50     ` [PATCH 01/10] clk: samsung: Remove excessive include Marek Szyprowski
2018-08-30  0:00       ` Chanwoo Choi
2018-08-30  6:34       ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155059eucas1p26a0ea66a0fc96c73cdd60648b82bd23e@eucas1p2.samsung.com>
2018-08-29 15:50     ` [PATCH 02/10] clk: samsung: s3c2410: Use generic helper for handling suspend/resume Marek Szyprowski
2018-08-30  1:10       ` Chanwoo Choi
2018-08-30  6:39       ` Krzysztof Kozlowski
2018-08-30 11:26         ` Marek Szyprowski
2018-08-31  6:34           ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155059eucas1p16fecde00348e0a2e6707aaf2a76320be@eucas1p1.samsung.com>
2018-08-29 15:50     ` [PATCH 03/10] clk: samsung: s3c2412: " Marek Szyprowski
2018-08-30  1:17       ` Chanwoo Choi
2018-08-30  6:42       ` Krzysztof Kozlowski
2018-08-30 12:50         ` Marek Szyprowski
2018-08-30 13:10           ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155100eucas1p1ba8149066e026fc15f82091968b78a08@eucas1p1.samsung.com>
2018-08-29 15:50     ` [PATCH 04/10] clk: samsung: s3c2443: " Marek Szyprowski
2018-08-30  1:18       ` Chanwoo Choi
2018-08-31  6:33       ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155100eucas1p16cded24187167d4af4d43f64c7abd88b@eucas1p1.samsung.com>
2018-08-29 15:50     ` [PATCH 05/10] clk: samsung: s3c64xx: " Marek Szyprowski
2018-08-30  1:18       ` Chanwoo Choi
2018-08-31  6:35       ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155101eucas1p2f6ecb6ad0eb37fa725ac950cad73c423@eucas1p2.samsung.com>
2018-08-29 15:50     ` Marek Szyprowski [this message]
2018-08-30  1:18       ` [PATCH 06/10] clk: samsung: s5pv210: " Chanwoo Choi
2018-08-31  6:36       ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155101eucas1p22b694bf6395d8efcb33ba3802e287c88@eucas1p2.samsung.com>
2018-08-29 15:50     ` [PATCH 07/10] clk: samsung: exynos5250: " Marek Szyprowski
2018-08-30  1:19       ` Chanwoo Choi
2018-08-31  6:36       ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155102eucas1p1ca7a26c10847dcb585f01b54657e29cb@eucas1p1.samsung.com>
2018-08-29 15:50     ` [PATCH 08/10] clk: samsung: Add support for setting registers state before suspend Marek Szyprowski
2018-08-30  1:36       ` Chanwoo Choi
2018-08-31 14:59       ` Krzysztof Kozlowski
2018-09-06 13:25         ` Marek Szyprowski
2018-09-06 16:15           ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155102eucas1p2a4b1c554623ff97a23f85f26a6b537e2@eucas1p2.samsung.com>
2018-08-29 15:50     ` [PATCH 09/10] clk: samsung: exynos4: Use generic helper for handling suspend/resume Marek Szyprowski
2018-09-06 19:49       ` Sylwester Nawrocki
2018-09-07  6:27         ` Marek Szyprowski
     [not found]   ` <CGME20180829155103eucas1p16b6cddb4babcfb60a3257e017bea347e@eucas1p1.samsung.com>
2018-08-29 15:50     ` [PATCH 10/10] clk: samsung: exynos5420: " Marek Szyprowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180829155046.29359-7-m.szyprowski@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=krzk@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=snawrocki@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.