From patchwork Wed Aug 31 12:55:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 75088 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp321493qga; Wed, 31 Aug 2016 05:56:23 -0700 (PDT) X-Received: by 10.98.87.90 with SMTP id l87mr16635291pfb.133.1472648183649; Wed, 31 Aug 2016 05:56:23 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id n3si50856004pac.161.2016.08.31.05.56.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 05:56:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F1966E74B; Wed, 31 Aug 2016 12:56:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.w1.samsung.com (mailout4.w1.samsung.com [210.118.77.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5AAE76E747 for ; Wed, 31 Aug 2016 12:56:17 +0000 (UTC) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OCR002JUYLT5C00@mailout4.w1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 31 Aug 2016 13:56:17 +0100 (BST) X-AuditID: cbfec7f4-f79cb6d000001359-4b-57c6d3f0a801 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 3E.00.04953.0F3D6C75; Wed, 31 Aug 2016 13:56:17 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OCR00GIKYLJHR40@eusync1.samsung.com>; Wed, 31 Aug 2016 13:56:16 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 6/6] media: s5p-jpeg: fix system and runtime pm integration Date: Wed, 31 Aug 2016 14:55:59 +0200 Message-id: <1472648159-9814-7-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1472648159-9814-1-git-send-email-m.szyprowski@samsung.com> References: <1472648159-9814-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNLMWRmVeSWpSXmKPExsVy+t/xy7ofLx8LN5jkYXFr3TlWi40z1rNa XPn6ns1i0v0JLBYv7l1ksXj9wtCiZ8NWVosZ5/cxWaw9cpfd4vCbdiB38ks2B26P+93HmTz6 tqxi9Pi8SS6AOYrLJiU1J7MstUjfLoErY8G6qcwFB7grPuyfwdLA+Imzi5GTQ0LARGL/yldM ELaYxIV769m6GLk4hASWMkp8ONnNApIQEmhikti0PxrEZhMwlOh628UGYosIpEp0r13PBNLA LPCYSeLNqvnsXYwcHMIC3hJn5mqB1LAIqEps2fEVbA6vgLvE68YWRohlchInj01mBbE5BTwk Vs96ywqxy11i7cPzrBMYeRcwMqxiFE0tTS4oTkrPNdQrTswtLs1L10vOz93ECAmyLzsYFx+z OsQowMGoxMObMeNouBBrYllxZe4hRgkOZiUR3nOXjoUL8aYkVlalFuXHF5XmpBYfYpTmYFES 5527632IkEB6YklqdmpqQWoRTJaJg1OqgbF6ZkLHlw9vJZhN2exbJvsz3rl159z1F5ULao7X fHXR2f55v92M/qgze9Iiamfdn32zQS9SW++9dPmWOQ5MHAvsq4SUby917HDaI2rPkvDRrjNC /c3DgDJBY+sL6lyOF9RLuC6Ex1+acEUvOujUuhynIIdAkw8tO/N2lW6O3TDprVBU0NWEP0os xRmJhlrMRcWJABoVycguAgAA Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Sylwester Nawrocki , Marek Szyprowski X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use generic helpers instead of open-coding usage of runtime pm for system sleep pm, which was potentially broken for some corner cases. Signed-off-by: Marek Szyprowski --- drivers/media/platform/s5p-jpeg/jpeg-core.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 785e6936c881..739ee49b9790 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -2996,27 +2996,11 @@ static int s5p_jpeg_runtime_resume(struct device *dev) } #endif /* CONFIG_PM */ -#ifdef CONFIG_PM_SLEEP -static int s5p_jpeg_suspend(struct device *dev) -{ - if (pm_runtime_suspended(dev)) - return 0; - - return s5p_jpeg_runtime_suspend(dev); -} - -static int s5p_jpeg_resume(struct device *dev) -{ - if (pm_runtime_suspended(dev)) - return 0; - - return s5p_jpeg_runtime_resume(dev); -} -#endif - static const struct dev_pm_ops s5p_jpeg_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(s5p_jpeg_suspend, s5p_jpeg_resume) - SET_RUNTIME_PM_OPS(s5p_jpeg_runtime_suspend, s5p_jpeg_runtime_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) + SET_RUNTIME_PM_OPS(s5p_jpeg_runtime_suspend, s5p_jpeg_runtime_resume, + NULL) }; static struct s5p_jpeg_variant s5p_jpeg_drvdata = {