From patchwork Thu Sep 6 15:55:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10590791 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F3B969B5 for ; Thu, 6 Sep 2018 15:56:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9196D2AE86 for ; Thu, 6 Sep 2018 15:56:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 858822AEAA; Thu, 6 Sep 2018 15:56:01 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 021CB2AE96 for ; Thu, 6 Sep 2018 15:56:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730364AbeIFUcI (ORCPT ); Thu, 6 Sep 2018 16:32:08 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:59529 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730358AbeIFUcH (ORCPT ); Thu, 6 Sep 2018 16:32:07 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180906155558euoutp02543284c4c2455aee8a29ad18755a586f~R2qb6ugNz3136531365euoutp029; Thu, 6 Sep 2018 15:55:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180906155558euoutp02543284c4c2455aee8a29ad18755a586f~R2qb6ugNz3136531365euoutp029 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1536249358; bh=B/btBmd7fmEvzdadhim6Z93O8J9igi0RZYs1C33JoGg=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=XmGjI32SrYvI6+SxTZUUEiQnILSeAcR58zAfei3fAdaCyzI5ZgKmFCboecbTKSaGr k/x+ct5qZnFcmPLKpKjZsUb3HHK7bLVUj5eHZS1HDWGbVPC1M1Ad98vF02n1qvZ/GW O/oZJMm/6kwvY7hvnL8HNwTNs4lZgN0k78UzeBPo= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180906155558eucas1p15bab6a87fff78eefd13ff08fb068c6a0~R2qbXagXO1238212382eucas1p1k; Thu, 6 Sep 2018 15:55:58 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id AD.56.04294.D0E419B5; Thu, 6 Sep 2018 16:55:57 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180906155556eucas1p26451379042b32e08d9199d6eab9841ef~R2qaZkBP10558005580eucas1p2P; Thu, 6 Sep 2018 15:55:56 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-c0-5b914e0dee00 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 19.CE.04284.C0E419B5; Thu, 6 Sep 2018 16:55:56 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PEN009IJ5L4PE10@eusync3.samsung.com>; Thu, 06 Sep 2018 16:55:56 +0100 (BST) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 06/10] clk: samsung: s5pv210: Use generic helper for handling suspend/resume Date: Thu, 06 Sep 2018 17:55:28 +0200 Message-id: <20180906155532.4085-7-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20180906155532.4085-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrIIsWRmVeSWpSXmKPExsWy7djP87q8fhOjDVYdULfYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbtH+9CWzA7vHplWdbB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CVcaXjEkvBC+GKLXdOsTYwXhLoYuTkkBAwkej9d4Kxi5GLQ0hgBaPE0ku3mCGcz4wS /dfbGGGqvk5dzwqRWMYoMav1B1RVA5PE13enmECq2AQMJbredrGB2CICDhKfP70Gm8ss8JhR YuvJr8wgCWGBRIkTk66xdzFycLAIqEoc/ekIEuYVsJHY1fKcFWKbvMTqDQfAyjkFbCVmzO0E 2ywh8JNV4uXN11BFLhLz1q9ig7CFJV4d38IOYctIdHYcZIJoaGaUaJ8xix3C6QG6Ys4OqA5r icPHL4JNYhbgk5i0bTozyEUSArwSHW1CECUeEptmvYCGzARGiasvXjNNYJRcwMiwilE8tbQ4 Nz212CgvtVyvODG3uDQvXS85P3cTIzDiTv87/mUH464/SYcYBTgYlXh4HxhNjBZiTSwrrsw9 xCjBwawkwutePSFaiDclsbIqtSg/vqg0J7X4EKM0B4uSOC+fVlq0kEB6YklqdmpqQWoRTJaJ g1OqgdHu8IHjMX6BpacM010urtStin6eYbvJKnJRS9jKxtMNR0Ku8Td8+2LuFskye03nq6VC 7DZi296rvHVe/m+Ok0ek/sr5l//Jcze96C2bIHXgudvSm0dV9ttdLVm9RdQm5sMaAznDlllp k6qUf6olm7Wq8RRGOx01edJ9fJfrZaEnrE37ihpfeimxFGckGmoxFxUnAgBvoHg/tAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDJMWRmVeSWpSXmKPExsVy+t/xq7o8fhOjDZpOW1lsnLGe1eL6l+es FufPb2C3+Nhzj9Vixvl9TBZrj9xlt2h/+pLZgd1j06pONo++LasYPT5vkgtgjuKySUnNySxL LdK3S+DKuNJxiaXghXDFljunWBsYLwl0MXJySAiYSHydup4VxBYSWMIo8WoefxcjF5DdxCTR eOcAE0iCTcBQouttFxuILSLgIPH502tGkCJmgceMEucWbwDrFhZIlDgx6Rp7FyMHB4uAqsTR n44gYV4BG4ldLc9ZIZbJS6zecIAZxOYUsJWYMbcTarGNxKrGKawTGHkWMDKsYhRJLS3OTc8t NtQrTswtLs1L10vOz93ECAyTbcd+bt7BeGlj8CFGAQ5GJR5eC9OJ0UKsiWXFlbmHGCU4mJVE eN2rJ0QL8aYkVlalFuXHF5XmpBYfYpTmYFES5z1vUBklJJCeWJKanZpakFoEk2Xi4JRqYDQt vMFqpX9ugW1MoUzbYzP/fskZgi+UVQ92eeilzCs4ONPh9C/9x983JEiabZq71PgYoxmD5tUv a59tUDup8+fNl+YrBw5oN8SsED/4sfj23sXqB+JOeF+7ellq+amzGd/zH9vx3596rdyX95tI /1v1bVsYPrV0f9vyKWFuB2ebS5GfoXKw42MlluKMREMt5qLiRAD1rupRDwIAAA== X-CMS-MailID: 20180906155556eucas1p26451379042b32e08d9199d6eab9841ef X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180906155556eucas1p26451379042b32e08d9199d6eab9841ef References: <20180906155532.4085-1-m.szyprowski@samsung.com> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace common suspend/resume handling code by generic helper. Almost no functional change, the only difference is in handling of hypothetical memory allocation failure on boot. Signed-off-by: Marek Szyprowski Acked-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- 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 #include #include -#include #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);