From patchwork Wed Aug 31 12:55:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 75087 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp321472qga; Wed, 31 Aug 2016 05:56:20 -0700 (PDT) X-Received: by 10.98.12.200 with SMTP id 69mr16541526pfm.15.1472648180842; Wed, 31 Aug 2016 05:56:20 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id e22si50850709pfd.76.2016.08.31.05.56.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 05:56:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 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 E34CB6E747; Wed, 31 Aug 2016 12:56:19 +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 14BE76E1C4 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 <0OCR001LCYLSMW00@mailout4.w1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 31 Aug 2016 13:56:16 +0100 (BST) X-AuditID: cbfec7f4-f79cb6d000001359-47-57c6d3ef5dd5 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 8C.00.04953.FE3D6C75; Wed, 31 Aug 2016 13:56:15 +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:15 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 5/6] media: s5p-cec: fix system and runtime pm integration Date: Wed, 31 Aug 2016 14:55:58 +0200 Message-id: <1472648159-9814-6-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+NgFprLLMWRmVeSWpSXmKPExsVy+t/xy7rvLx8LN7jwxcbi1rpzrBYbZ6xn tbjy9T2bxaT7E1gsXty7yGLx+oWhRc+GrawWM87vY7JYe+Quu8XhN+1A7uSXbA7cHve7jzN5 9G1ZxejxeZNcAHMUl01Kak5mWWqRvl0CV8a21TNZCn5xVvyZupW5gfEQRxcjJ4eEgInEns5D 7BC2mMSFe+vZQGwhgaWMEjsn+XUxcgHZTUwS65vXgBWxCRhKdL3tAisSEUiV6F67ngmkiFng MZPEm1XzwYqEBbwk9i34wgxiswioSjzvbQBr4BVwl9gyZTnUNjmJk8cms4LYnAIeEqtnvWWF 2OwusfbhedYJjLwLGBlWMYqmliYXFCel5xrqFSfmFpfmpesl5+duYoQE2pcdjIuPWR1iFOBg VOLhzZhxNFyINbGsuDL3EKMEB7OSCO+5S8fChXhTEiurUovy44tKc1KLDzFKc7AoifPO3fU+ REggPbEkNTs1tSC1CCbLxMEp1cA45ZAJe7kk7yv+oCu1fv0JGzb0VNQeDGkMk+5etvup1JFz ejeU27jjmPV/duXvTEvu+rkoec7zS0c+SIQ/ePVVgbFsc8ed8qVOa07p7Fax1zYs6Spt19nc mXtEs0YykLd6faSJ3F/WLzvmvDj2zTVk6YM5Brump0lUKD3xt97XGRL4befWm15KLMUZiYZa zEXFiQDL6JuAMAIAAA== 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/staging/media/s5p-cec/s5p_cec.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c b/drivers/staging/media/s5p-cec/s5p_cec.c index 78333273c4e5..77d9887801b8 100644 --- a/drivers/staging/media/s5p-cec/s5p_cec.c +++ b/drivers/staging/media/s5p-cec/s5p_cec.c @@ -250,22 +250,9 @@ static int s5p_cec_runtime_resume(struct device *dev) return 0; } -static int __maybe_unused s5p_cec_suspend(struct device *dev) -{ - if (pm_runtime_suspended(dev)) - return 0; - return s5p_cec_runtime_suspend(dev); -} - -static int __maybe_unused s5p_cec_resume(struct device *dev) -{ - if (pm_runtime_suspended(dev)) - return 0; - return s5p_cec_runtime_resume(dev); -} - static const struct dev_pm_ops s5p_cec_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(s5p_cec_suspend, s5p_cec_resume) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) SET_RUNTIME_PM_OPS(s5p_cec_runtime_suspend, s5p_cec_runtime_resume, NULL) };