From patchwork Thu Sep 6 15:55:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10590801 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 3C5B769BA for ; Thu, 6 Sep 2018 15:56:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30E312AE86 for ; Thu, 6 Sep 2018 15:56:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 253132AE90; Thu, 6 Sep 2018 15:56:02 +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 826762AEA6 for ; Thu, 6 Sep 2018 15:56:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730304AbeIFUcI (ORCPT ); Thu, 6 Sep 2018 16:32:08 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46869 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730364AbeIFUcH (ORCPT ); Thu, 6 Sep 2018 16:32:07 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180906155557euoutp01faf6090c9d6179fda02346e60238a4e4~R2qa3UWpB1567915679euoutp014; Thu, 6 Sep 2018 15:55:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180906155557euoutp01faf6090c9d6179fda02346e60238a4e4~R2qa3UWpB1567915679euoutp014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1536249357; bh=emB5fOdp7j4ZrlI8bJ7cjYP3wU85Vhkd5vXaiPYYECk=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Bg3ay2cZsy5OmwDAjwKjnwnlZ2WKERJdObGENZ/Lzu60g9IIqyeb8Pe4hXwxug9sj 88rjilrjGCm6YOeIlJHM3aB0PWc6D9p/uWDOVPk9gofEo9dlvNGgcMEF+2gJaGUD5Z uJjPgBbst2EVAj1spSaC2Q4PSf1zdfC7aKyg8OxY= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180906155556eucas1p1f401491b1fec081703790f1d264c9e34~R2qaD-Jac1238612386eucas1p1_; Thu, 6 Sep 2018 15:55:56 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 0D.56.04294.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 20180906155555eucas1p23adcf0ad28416aefacb8519f8f5741ed~R2qZH8duA2540625406eucas1p2H; Thu, 6 Sep 2018 15:55:55 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-bc-5b914e0c8546 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 87.DC.04128.B0E419B5; Thu, 6 Sep 2018 16:55:55 +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:55 +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 02/10] clk: samsung: s3c2410: Use generic helper for handling suspend/resume Date: Thu, 06 Sep 2018 17:55:24 +0200 Message-id: <20180906155532.4085-3-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+NgFlrIIsWRmVeSWpSXmKPExsWy7djP87o8fhOjDabsErTYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbtH+9CWzA7vHplWdbB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CVsenoVJaCO8IVM/99Zm5gPCrQxcjJISFgIvFt5Qf2LkYuDiGBFYwSbze1M0E4nxkl 2hoPMXcxcoBVffqVCRFfxigx/04fG4TTwCQx8/81NpBRbAKGEl1vu8BsEQEHic+fXjOCFDEL PGaU2HryKzNIQlggUWLhl8OMIDaLgKrEsvXTWEFsXgEbifMNh1khbpKXWL3hAFg9p4CtxIy5 nawggyQEfrJKNFzdwwxR5CLRsO8jG4QtLPHq+BZ2CFtG4vLkbhaIhmZGifYZs9ghnB6gM+bs gOqwljh8/CLYOmYBPolJ26ZDPcor0dEmBFHiIbFlzxQWiD8nMErsOHiKZQKj5AJGhlWM4qml xbnpqcVGeanlesWJucWleel6yfm5mxiBEXf63/EvOxh3/Uk6xCjAwajEw/vAaGK0EGtiWXFl 7iFGCQ5mJRFe9+oJ0UK8KYmVValF+fFFpTmpxYcYpTlYlMR5+bTSooUE0hNLUrNTUwtSi2Cy TBycUg2MLftlmF7VTnA/1/VovoBXQaap2MneR8sVV4mZfCxbbLzFxOfcLU4XpY+ecmv7U25r uhSdWlwb8Pz80rROBsZtlVwNCtW55yof3hZq9Pog9t+T69jkgFPFMjfqcrc+OPHcROa0whtP I8aZ0Yq+27S957/6F7VVK6lqnrfdxqCVjxIa5/FcLXFTYinOSDTUYi4qTgQAqCB4w7QCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDJMWRmVeSWpSXmKPExsVy+t/xq7rcfhOjDa6eVbTYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbtH+9CWzA7vHplWdbB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CVsenoVJaCO8IVM/99Zm5gPCrQxcjBISFgIvHpV2YXIyeHkMASRonL1zW6GLmA7CYm iZaFs5lAEmwChhJdb7vYQGwRAQeJz59eM4IUMQs8ZpQ4t3gDK0hCWCBRYuGXw4wgNouAqsSy 9dPA4rwCNhLnGw6D2RIC8hKrNxxgBrE5BWwlZsztZIXYbCOxqnEK6wRGngWMDKsYRVJLi3PT c4uN9IoTc4tL89L1kvNzNzECw2TbsZ9bdjB2vQs+xCjAwajEw2thOjFaiDWxrLgy9xCjBAez kgive/WEaCHelMTKqtSi/Pii0pzU4kOM0hwsSuK85w0qo4QE0hNLUrNTUwtSi2CyTBycUg2M ylzCU9b/2rh4S43Yik3+uXx1azrTFZUl17Otv/d+reKuwt2XnPd+PWh3f7WSrfTWFS3Kfqni KYYrncIX+rV9Lb8zbaXonCuvs6pWNTGcV1p8tzN7V7q79eZ50yurLEuuWsVlBe075RMnp+R4 +sXdM43TfX6UHHt+jEdooUrXBj2d66tSSnzslViKMxINtZiLihMBTWfdRg8CAAA= X-CMS-MailID: 20180906155555eucas1p23adcf0ad28416aefacb8519f8f5741ed X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180906155555eucas1p23adcf0ad28416aefacb8519f8f5741ed 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-s3c2410.c | 43 ++----------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/drivers/clk/samsung/clk-s3c2410.c b/drivers/clk/samsung/clk-s3c2410.c index a9c887475054..8cb868f06257 100644 --- a/drivers/clk/samsung/clk-s3c2410.c +++ b/drivers/clk/samsung/clk-s3c2410.c @@ -11,7 +11,6 @@ #include #include #include -#include #include @@ -40,9 +39,6 @@ enum s3c2410_plls { static void __iomem *reg_base; -#ifdef CONFIG_PM_SLEEP -static struct samsung_clk_reg_dump *s3c2410_save; - /* * list of controller registers to be saved and restored during a * suspend/resume cycle. @@ -57,42 +53,6 @@ static unsigned long s3c2410_clk_regs[] __initdata = { CAMDIVN, }; -static int s3c2410_clk_suspend(void) -{ - samsung_clk_save(reg_base, s3c2410_save, - ARRAY_SIZE(s3c2410_clk_regs)); - - return 0; -} - -static void s3c2410_clk_resume(void) -{ - samsung_clk_restore(reg_base, s3c2410_save, - ARRAY_SIZE(s3c2410_clk_regs)); -} - -static struct syscore_ops s3c2410_clk_syscore_ops = { - .suspend = s3c2410_clk_suspend, - .resume = s3c2410_clk_resume, -}; - -static void __init s3c2410_clk_sleep_init(void) -{ - s3c2410_save = samsung_clk_alloc_reg_dump(s3c2410_clk_regs, - ARRAY_SIZE(s3c2410_clk_regs)); - if (!s3c2410_save) { - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", - __func__); - return; - } - - register_syscore_ops(&s3c2410_clk_syscore_ops); - return; -} -#else -static void __init s3c2410_clk_sleep_init(void) {} -#endif - PNAME(fclk_p) = { "mpll", "div_slow" }; static struct samsung_mux_clock s3c2410_common_muxes[] __initdata = { @@ -461,7 +421,8 @@ void __init s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f, ARRAY_SIZE(s3c244x_common_aliases)); } - s3c2410_clk_sleep_init(); + samsung_clk_sleep_init(reg_base, s3c2410_clk_regs, + ARRAY_SIZE(s3c2410_clk_regs)); samsung_clk_of_add_provider(np, ctx); }