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: 146107 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp38493ljw; Thu, 6 Sep 2018 08:56:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaK2ttNsrsjac3qGnK+YVHlnkBNf3yghrGs5CTfxtG1kTu5jZhpiVb76fVxqcBpYMNMcGRg X-Received: by 2002:a63:3f45:: with SMTP id m66-v6mr3439428pga.51.1536249363072; Thu, 06 Sep 2018 08:56:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536249363; cv=none; d=google.com; s=arc-20160816; b=cC+ICO+h4f5SAPIhLyL4X2IrzgUdVSYwaCFzECaJpGLhU7pwCzhO5BDLhNxqpSyNjw 1jjxEAFJ5W2bDMCyQTR5OuLxsXFI2Cx9Om14UTZvVi84vNjYZmKOPfQHWiq+bhemI95N fv9R65yG1Zp+HqTtW2yeqczTvZ5pQ7Db7YvLtEr04VsziA+ApA/Cjhpfl+mRuB7Thb+x Kvru/+oFMXuF8pm4Grkw44QFcSn61jNiJditViUBkGxQxKN4T4cDFyg3WV9uhYJ4ELck /QMVXZk1i5NXjm7+LtdzF6Svx11X4AFwmHYnv7Cihfgo0GtENeDIuy7h3YW+EnR5Ll3M ZsIQ== 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:dkim-signature:dkim-filter; bh=B/btBmd7fmEvzdadhim6Z93O8J9igi0RZYs1C33JoGg=; b=F4efVR8q/8kbldariYDX45Vi3nY0zk2w4OpzrMvL741LgVFWaS+BzQ+M9th9xZCGH/ U+q6vfzqz1uTXoPerJnwsKwBht3oFHYz10Bz9PXPS2RDAfTXzySfbVwGOT0unMSYxSoO fo08eiiKK/xM83esov1+Ptl6VPlxf7dibwfZLNEKTlqQ8Ri+KCSZZjDRlvIfdHEJwZXI EmU84yKSOWDfNI6oGuvgTBMdfKT8AVhkKQC3b2KlM64N4htw75WBq4rR0arXgj5G6ES2 VDtqgpG3VyJ+leOjakqNFix+I+lqX3CuTJxJitn21wZXExD/HwD+MCOuQGj1YfSnFRui f4ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=XmGjI32S; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (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 k18-v6si5180597pff.91.2018.09.06.08.56.02; Thu, 06 Sep 2018 08:56:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=XmGjI32S; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730445AbeIFUcI (ORCPT + 3 others); 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-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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(-) -- 2.17.1 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);