From patchwork Wed Nov 16 09:04:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 82457 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp56559obn; Wed, 16 Nov 2016 01:05:46 -0800 (PST) X-Received: by 10.99.155.26 with SMTP id r26mr6025226pgd.165.1479287146736; Wed, 16 Nov 2016 01:05:46 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c17si30907176pgj.137.2016.11.16.01.05.46; Wed, 16 Nov 2016 01:05:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935195AbcKPJFn (ORCPT + 4 others); Wed, 16 Nov 2016 04:05:43 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:57448 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752648AbcKPJF1 (ORCPT ); Wed, 16 Nov 2016 04:05:27 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGQ00JHA98X7580@mailout3.w1.samsung.com>; Wed, 16 Nov 2016 09:05:21 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20161116090521eucas1p2bd057ca1e1153bd14aae40125c68de86~He8yPMkpI0300603006eucas1p26; Wed, 16 Nov 2016 09:05:21 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 46.A5.28332.0512C285; Wed, 16 Nov 2016 09:05:20 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20161116090520eucas1p151e1da5cba8c5b85f9fe63e77650c091~He8xfFkml3104431044eucas1p1q; Wed, 16 Nov 2016 09:05:20 +0000 (GMT) X-AuditID: cbfec7f4-f791c6d000006eac-5a-582c21500747 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id DF.48.10494.5312C285; Wed, 16 Nov 2016 09:04:53 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OGQ00GDL98JU960@eusync2.samsung.com>; Wed, 16 Nov 2016 09:05:20 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Seung-Woo Kim , Bartlomiej Zolnierkiewicz , Javier Martinez Canillas , Andrzej Hajda , Inki Dae Subject: [PATCH 5/9] s5p-mfc: Remove dead conditional code Date: Wed, 16 Nov 2016 10:04:54 +0100 Message-id: <1479287098-30493-6-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1479287098-30493-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAIsWRmVeSWpSXmKPExsWy7djP87oBijoRBsvbTS1urTvHarFxxnpW i0n3J7BYvHm7hsni/PkN7BY9G7ayWsw4v4/JYu2Ru+wWh9+0A7mTX7I5cHlsWtXJ5rGl/y67 R9+WVYwenzfJBbBEcdmkpOZklqUW6dslcGV8vbySsaBTsWLRxlssDYxXpbsYOTkkBEwkrm5o Y4OwxSQu3FsPZHNxC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5+NUkDCvgIfE7NXf2SG2yUmcPDaZFcTmFPCUeDLzFVi5EFDN 8qOmExh5FzAyrGIUSS0tzk3PLTbSK07MLS7NS9dLzs/dxAgM723Hfm7Zwdj1LvgQowAHoxIP 7wJ17Qgh1sSy4srcQ4wSHMxKIrzXBXUihHhTEiurUovy44tKc1KLDzGaAp00kVlKNDkfGHt5 JfGGJobmloZGxhYW5kZGSuK8Uz9cCRcSSE8sSc1OTS1ILYLpY+LglGpg9H45jZ/l9s+Tb3fn X15h7LxD0eizrTffkVRFFq6ayXzXHL8dlz6hsfV62Z+PBstbvng9vbHX/m37wann627O6ys+ kte7yneH07LEhG0TOu8nnljsystfuVNGIm22slR0yipJn4VuF07fds8tnv/3uO1xkzf7zW+s O3l9WkjiBHdum71Gwkft+JVYijMSDbWYi4oTAXpGFqWFAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161116090520eucas1p151e1da5cba8c5b85f9fe63e77650c091 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161116090520eucas1p151e1da5cba8c5b85f9fe63e77650c091 X-RootMTR: 20161116090520eucas1p151e1da5cba8c5b85f9fe63e77650c091 References: <1479287098-30493-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org CONFIG_PM is always enabled on Exynos platforms, so remove dead code related to early development of MFC driver on platform without PM support. Signed-off-by: Marek Szyprowski --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 22 ------------------ drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 1 - drivers/media/platform/s5p-mfc/s5p_mfc_pm.c | 30 +++++-------------------- 3 files changed, 5 insertions(+), 48 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 30ceae7eabc5..72af819a4f47 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1404,31 +1404,9 @@ static int s5p_mfc_resume(struct device *dev) } #endif -#ifdef CONFIG_PM -static int s5p_mfc_runtime_suspend(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct s5p_mfc_dev *m_dev = platform_get_drvdata(pdev); - - atomic_set(&m_dev->pm.power, 0); - return 0; -} - -static int s5p_mfc_runtime_resume(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct s5p_mfc_dev *m_dev = platform_get_drvdata(pdev); - - atomic_set(&m_dev->pm.power, 1); - return 0; -} -#endif - /* Power management */ static const struct dev_pm_ops s5p_mfc_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(s5p_mfc_suspend, s5p_mfc_resume) - SET_RUNTIME_PM_OPS(s5p_mfc_runtime_suspend, s5p_mfc_runtime_resume, - NULL) }; static struct s5p_mfc_buf_size_v5 mfc_buf_size_v5 = { diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index c068ee3ece6e..58b15c212dd2 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -200,7 +200,6 @@ struct s5p_mfc_pm { struct clk *clock; struct clk *clock_gate; bool use_clock_gating; - atomic_t power; struct device *device; }; diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c index 818c04646061..11a918eb7564 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c @@ -21,14 +21,9 @@ #define MFC_GATE_CLK_NAME "mfc" #define MFC_SCLK_NAME "sclk_mfc" -#define CLK_DEBUG - static struct s5p_mfc_pm *pm; static struct s5p_mfc_dev *p_dev; - -#ifdef CLK_DEBUG static atomic_t clk_ref; -#endif int s5p_mfc_init_pm(struct s5p_mfc_dev *dev) { @@ -64,14 +59,10 @@ int s5p_mfc_init_pm(struct s5p_mfc_dev *dev) } } - atomic_set(&pm->power, 0); -#ifdef CONFIG_PM pm->device = &dev->plat_dev->dev; pm_runtime_enable(pm->device); -#endif -#ifdef CLK_DEBUG atomic_set(&clk_ref, 0); -#endif + return 0; err_s_clk: @@ -95,18 +86,16 @@ void s5p_mfc_final_pm(struct s5p_mfc_dev *dev) clk_unprepare(pm->clock_gate); clk_put(pm->clock_gate); pm->clock_gate = NULL; -#ifdef CONFIG_PM pm_runtime_disable(pm->device); -#endif } int s5p_mfc_clock_on(void) { int ret = 0; -#ifdef CLK_DEBUG + atomic_inc(&clk_ref); mfc_debug(3, "+ %d\n", atomic_read(&clk_ref)); -#endif + if (!pm->use_clock_gating) return 0; if (!IS_ERR_OR_NULL(pm->clock_gate)) @@ -116,10 +105,9 @@ int s5p_mfc_clock_on(void) void s5p_mfc_clock_off(void) { -#ifdef CLK_DEBUG atomic_dec(&clk_ref); mfc_debug(3, "- %d\n", atomic_read(&clk_ref)); -#endif + if (!pm->use_clock_gating) return; if (!IS_ERR_OR_NULL(pm->clock_gate)) @@ -130,13 +118,10 @@ int s5p_mfc_power_on(void) { int ret = 0; -#ifdef CONFIG_PM ret = pm_runtime_get_sync(pm->device); if (ret) return ret; -#else - atomic_set(&pm->power, 1); -#endif + if (!pm->use_clock_gating && !IS_ERR_OR_NULL(pm->clock_gate)) ret = clk_enable(pm->clock_gate); return ret; @@ -146,12 +131,7 @@ int s5p_mfc_power_off(void) { if (!pm->use_clock_gating && !IS_ERR_OR_NULL(pm->clock_gate)) clk_disable(pm->clock_gate); -#ifdef CONFIG_PM return pm_runtime_put_sync(pm->device); -#else - atomic_set(&pm->power, 0); - return 0; -#endif }