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: 146104 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp38465ljw; Thu, 6 Sep 2018 08:56:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYLQRdg+IQBH9ZqG5jtxA/cBUyIRq32ec0R0FoK9MAw+j2n5nYKMEewxTjCnAFSCj73bKFr X-Received: by 2002:a62:808c:: with SMTP id j134-v6mr3573767pfd.120.1536249361735; Thu, 06 Sep 2018 08:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536249361; cv=none; d=google.com; s=arc-20160816; b=kWBC9KeGrWSLkTuURX0to3Bhfvvl15uY+A+xP9v7PiGguum8c4FtaZdZNjCFJStYl7 D+2sIRfcRWrrc+9rRvK+W4zTGv5KQxXdWKYBv6FpBz0uiTgMFr2d/38K4KDw6LKvNffC Kr5+amCherEiaocfkZWy4gomtm5bvHpDZQMnbA1d5ir6U3a+4YuU/3g9JjvvzL8CzDcA ooiN4i+y+FlaThEuHBPBc0Y/PyObM7/0sgkS/XBasR0aBmDTNblwsYYDENgY2hciICR6 3L8/fkyTigxnSZkiVZexOjEzTx6eoGkoDBjMjFmr98O/ujGp2PaN0q/v+VaPNhTVFkJT OpKw== 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=emB5fOdp7j4ZrlI8bJ7cjYP3wU85Vhkd5vXaiPYYECk=; b=jiEqf8hcGrB4LQZNmpuE5bIObhPhpi7MaWByGGjKZuViQZVS1N8NhlVZBHOP1bj5gx O/A2j96KWZ87NZp7R80gdA/yD2T5yvAnvTZpRVzr2Qa8TkD0q2AadfhG7D06QX/SgQ83 UEmC4KPvzFI5nFNJkAC+ierkc2D2uNHT4gtStBZdHxltbtXpiKQ18cGGmgBIM1GipRtr JUGh3b4OctW0jTBtDgz5O0W/1fM+4HS0he6+rC953YwoxyDnaAkM8Wd85tSCRmoTCNcH sWhxPveGo2CNSc97Qf5ysapwAhNbN03mZHgtl5EJ9ny+AFzjzECBH572fOCmarjTzj1v YNfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Bg3ay2cZ; 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.01; Thu, 06 Sep 2018 08:56:01 -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=Bg3ay2cZ; 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 S1730429AbeIFUcI (ORCPT + 3 others); 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-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-s3c2410.c | 43 ++----------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) -- 2.17.1 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); }