From patchwork Thu Sep 6 15:55:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 146111 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp38501ljw; Thu, 6 Sep 2018 08:56:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZNcDFN+YVvytXaIrZmKxx13nWQnGljU1SQqLJMyX9EH19nBRNVLDcvypdLoDbi5YPiqt8Z X-Received: by 2002:a63:fc55:: with SMTP id r21-v6mr683405pgk.377.1536249363620; 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=ybACz36M70AUKrVkDtytNQqO4k+nMhxe6yZQzmpZq4L5vRwkBR+0kfbGD9eOAozWYH qmGXj0gEpM4Lf8/cCbMkpzIPTX7Ddv2yr3RH41PcPJngPjVCMXtpkbdkKtGkVDFlr6ES 5Xzuv9o1nCD+I7PIR4zCb2VF/nFlD5G+iX1zPWqNBvBe2nmDd+hptDdHtxTY98rkNoGC oxErvx8oN+bESXv87mXMMH5FgbPxVSjEyCMWLGN919+ZkgCWAyc6+1k6H3VUmviOYkIZ u9FjGwwwUKPBfJYtTHjBkv2OqMYBy5aOm1690b3QGTRoe10l2c/lQfnxY+C2ChwaYJQ6 I73g== 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=VGEaPtZRW2v0h9vmhjnQR67U2fTUUB34E+GMkkQq6BU=; b=yyE4EJzkoJU7jR/gwsUYk19r1bfca8iLQhRAMRPbvNuDi9l7j3XUnDc1O2HqzEY5Mv l+9XkeslXOpbWrcT5RQyN/V8RE8gue9r7sa6LbVC6NQj5Fhw0EZ79L+Uaa1+axKvIU7o IiehcsYaHudqqxXEYJrkyhYOzbKbCHVRSSfJ4By30YPG3QNNMJZP6LtNqc2aVVd2W4Vd rD/6HRvmkn47k8nbSvJbupZn7BjsklmX88DdRVYvtEvVFzSCfUIT0FFhVCXUzWLUal/G GFGCD8yLuGdhKqUKY9zNmGVgoanGbCt+2X6LWKfB3pmFHbCxg4sBlOGJR7P61+0rVKOV QIBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=WKdy3PXj; 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.03; 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=WKdy3PXj; 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 S1730413AbeIFUcJ (ORCPT + 3 others); Thu, 6 Sep 2018 16:32:09 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46872 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730389AbeIFUcI (ORCPT ); Thu, 6 Sep 2018 16:32:08 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180906155557euoutp0171951b2a94ddc0507eaf3e8f9e7794bf~R2qa-VvLW1529315293euoutp01U; Thu, 6 Sep 2018 15:55:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180906155557euoutp0171951b2a94ddc0507eaf3e8f9e7794bf~R2qa-VvLW1529315293euoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1536249357; bh=VGEaPtZRW2v0h9vmhjnQR67U2fTUUB34E+GMkkQq6BU=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=WKdy3PXjYJWSWeHQTFqGPTEHZmbNMKcc+mpoLyOjlapFopefqKnqJsIOJJj8HHsh/ qxNabqKPe8iUFpTCqpTXWp3Df7+8kd2aiqjiSYwbeoU8R6Ojt4ELl8yLX2zeO6/xEG iCC/rWxrxa7ewpnNF1byfNE9GRCihIo2NmvnkHwQ= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180906155557eucas1p13a98fc7af9753a993eb2ffe353aa0b2e~R2qajWQeL1224912249eucas1p19; Thu, 6 Sep 2018 15:55:57 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F4.31.04806.C0E419B5; Thu, 6 Sep 2018 16:55:56 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180906155556eucas1p26cc9f85524938192ea01bde8e1b977e2~R2qZxpoCk2540625406eucas1p2I; Thu, 6 Sep 2018 15:55:56 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-98-5b914e0c284a Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 28.DC.04128.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 04/10] clk: samsung: s3c2443: Use generic helper for handling suspend/resume Date: Thu, 06 Sep 2018 17:55:26 +0200 Message-id: <20180906155532.4085-5-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+NgFlrAIsWRmVeSWpSXmKPExsWy7djP87o8fhOjDXa0G1lsnLGe1eL6l+es FufPb2C3+Nhzj9Vixvl9TBZrj9xlt2h/+pLZgd1j06pONo++LasYPT5vkgtgjuKySUnNySxL LdK3S+DK6Lx5kq3gm3DFk+uPWRoYbwp0MXJwSAiYSDzbp9HFyMUhJLCCUeJk5ycmCOczo8SP 6XeZuxg5wYp+b+5nA7GFBJYxSpw7ww9R1MAk8fXdKSaQBJuAoUTX2y6wIhEBB4nPn14zghQx CzxmlNh68ivYJGGBRImdH2+wg9gsAqoSrdN+sYLYvAI2Ev335zBCbJOXWL3hAFg9p4CtxIy5 nawggyQEvrJK/L5xBOokF4kznUvYIWxhiVfHt0DZMhKXJ3ezQDQ0M0q0z5jFDuH0AJ0xZwcb RJW1xOHjF8FWMwvwSUzaNp0ZEhq8Eh1tQhAlHhITvy1lg/hzAqPE2TUXWCcwSi5gZFjFKJ5a WpybnlpsnJdarlecmFtcmpeul5yfu4kRGG+n/x3/uoNx35+kQ4wCHIxKPLwPjCZGC7EmlhVX 5h5ilOBgVhLhda+eEC3Em5JYWZValB9fVJqTWnyIUZqDRUmcl08rLVpIID2xJDU7NbUgtQgm y8TBKdXAOIF7hw63yz+DD8J111X/XrevfODK/We+Fsfz+ISNjZq/+45s7fQ7m7A1wH7XsqaQ HWddV8w/42QjVesmI3l8forrJ/5o//5158I2/K9kz79t73o9qPhsK9fH2/YfDbb2TXo7aZ3o mntCb09xmLRzSta+2FG54Kd2R+tapetbRaf5err224XZKbEUZyQaajEXFScCAOBlNWWzAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xq7o8fhOjDbYu4rfYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbtH+9CWzA7vHplWdbB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CV0XnzJFvBN+GKJ9cfszQw3hToYuTkkBAwkfi9uZ+ti5GLQ0hgCaPEin+rmSGcJiaJ xjsHmECq2AQMJbredrGB2CICDhKfP71mBCliFnjMKHFu8QZWkISwQKLEzo832EFsFgFVidZp v8DivAI2Ev335zBCrJOXWL3hADOIzSlgKzFjbidYjRBQzarGKawTGHkWMDKsYhRJLS3OTc8t NtIrTswtLs1L10vOz93ECAyVbcd+btnB2PUu+BCjAAejEg+vhenEaCHWxLLiytxDjBIczEoi vO7VE6KFeFMSK6tSi/Lji0pzUosPMUpzsCiJ8543qIwSEkhPLEnNTk0tSC2CyTJxcEo1MM5x dzDpWhS/Lr531V2jYOcjlr059SYKHz5Xl+4sPHjmXp2t4s/9H3vO5U/s22fF/zov6aqZv+CT Qg0xX9aKCzdbGHX81s/3PbxUJrVwft2b6h9HVq3d5iv943dEymeWjBWuEpI9b9g38B3nOPVG qrN4mZ3flOe6pUx2N7h4l/mGa6UcbogzVGIpzkg01GIuKk4EAGhW+ZMRAgAA X-CMS-MailID: 20180906155556eucas1p26cc9f85524938192ea01bde8e1b977e2 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180906155556eucas1p26cc9f85524938192ea01bde8e1b977e2 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-s3c2443.c | 43 ++----------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) -- 2.17.1 diff --git a/drivers/clk/samsung/clk-s3c2443.c b/drivers/clk/samsung/clk-s3c2443.c index c46e6d5bc9bc..884067e4f1a1 100644 --- a/drivers/clk/samsung/clk-s3c2443.c +++ b/drivers/clk/samsung/clk-s3c2443.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -43,9 +42,6 @@ enum supported_socs { static void __iomem *reg_base; -#ifdef CONFIG_PM_SLEEP -static struct samsung_clk_reg_dump *s3c2443_save; - /* * list of controller registers to be saved and restored during a * suspend/resume cycle. @@ -65,42 +61,6 @@ static unsigned long s3c2443_clk_regs[] __initdata = { SCLKCON, }; -static int s3c2443_clk_suspend(void) -{ - samsung_clk_save(reg_base, s3c2443_save, - ARRAY_SIZE(s3c2443_clk_regs)); - - return 0; -} - -static void s3c2443_clk_resume(void) -{ - samsung_clk_restore(reg_base, s3c2443_save, - ARRAY_SIZE(s3c2443_clk_regs)); -} - -static struct syscore_ops s3c2443_clk_syscore_ops = { - .suspend = s3c2443_clk_suspend, - .resume = s3c2443_clk_resume, -}; - -static void __init s3c2443_clk_sleep_init(void) -{ - s3c2443_save = samsung_clk_alloc_reg_dump(s3c2443_clk_regs, - ARRAY_SIZE(s3c2443_clk_regs)); - if (!s3c2443_save) { - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", - __func__); - return; - } - - register_syscore_ops(&s3c2443_clk_syscore_ops); - return; -} -#else -static void __init s3c2443_clk_sleep_init(void) {} -#endif - PNAME(epllref_p) = { "mpllref", "mpllref", "xti", "ext" }; PNAME(esysclk_p) = { "epllref", "epll" }; PNAME(mpllref_p) = { "xti", "mdivclk" }; @@ -450,7 +410,8 @@ void __init s3c2443_common_clk_init(struct device_node *np, unsigned long xti_f, break; } - s3c2443_clk_sleep_init(); + samsung_clk_sleep_init(reg_base, s3c2443_clk_regs, + ARRAY_SIZE(s3c2443_clk_regs)); samsung_clk_of_add_provider(np, ctx);