From patchwork Wed Nov 16 09:04:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 82459 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp56609obn; Wed, 16 Nov 2016 01:05:54 -0800 (PST) X-Received: by 10.98.65.156 with SMTP id g28mr2978306pfd.110.1479287154792; Wed, 16 Nov 2016 01:05:54 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p123si25387879pfg.149.2016.11.16.01.05.54; Wed, 16 Nov 2016 01:05:54 -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 S934857AbcKPJFu (ORCPT + 4 others); Wed, 16 Nov 2016 04:05:50 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:64098 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934742AbcKPJFb (ORCPT ); Wed, 16 Nov 2016 04:05:31 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGQ00GMB98W7P80@mailout2.w1.samsung.com>; Wed, 16 Nov 2016 09:05:21 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20161116090521eucas1p17995d302a40fe2ef9f8e69384da57700~He8yovztI0322403224eucas1p1I; Wed, 16 Nov 2016 09:05:21 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id C2.EB.23383.2512C285; Wed, 16 Nov 2016 09:05:22 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20161116090520eucas1p1014c941bfe4fbe11392f8d9028e6f4f1~He8x6xexB0108601086eucas1p1x; Wed, 16 Nov 2016 09:05:20 +0000 (GMT) X-AuditID: cbfec7ef-f79e76d000005b57-bb-582c2152b786 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 80.58.10494.5312C285; Wed, 16 Nov 2016 09:04:54 +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 6/9] s5p-mfc: Kill all IS_ERR_OR_NULL in clocks management code Date: Wed, 16 Nov 2016 10:04:55 +0100 Message-id: <1479287098-30493-7-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+NgFrrEIsWRmVeSWpSXmKPExsWy7djP87pBijoRBsvXiVvcWneO1WLjjPWs FpPuT2CxePN2DZPF+fMb2C16NmxltZhxfh+Txdojd9ktDr9pB3Inv2Rz4PLYtKqTzWNL/112 j74tqxg9Pm+SC2CJ4rJJSc3JLEst0rdL4Mp40bubvWAZX8WKe3fYGxj/cXcxcnJICJhIHGib xgZhi0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TusGKWARUJb4enQIW5xXwkJi/dxczxDo5iZPHJrOC2JwCnhJPZr5iAblICKhm +VHTCYy8CxgZVjGKpJYW56bnFhvpFSfmFpfmpesl5+duYgQG97ZjP7fsYOx6F3yIUYCDUYmH d4G6doQQa2JZcWXuIUYJDmYlEd7rgjoRQrwpiZVVqUX58UWlOanFhxhNgW6ayCwlmpwPjLy8 knhDE0NzS0MjYwsLcyMjJXHeqR+uhAsJpCeWpGanphakFsH0MXFwSjUwLmGIXVb285L2ua1T 3aMt5h0x3bRD1mRnZvsBsXl+CQdXzBHj+rN3yVQ1h8k2wmuX2vYfnvmB+bpt1741eyZai7gv 96q9kc4nyaMvnhETviRHc4+08axqg7SHKe9llW6e/rtjl6nPoyf/8q5+ilq6tUXp4+PfE2Uy X/7JLOV55bbzTKWh0o/dXkosxRmJhlrMRcWJAClu8r6EAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161116090520eucas1p1014c941bfe4fbe11392f8d9028e6f4f1 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: 20161116090520eucas1p1014c941bfe4fbe11392f8d9028e6f4f1 X-RootMTR: 20161116090520eucas1p1014c941bfe4fbe11392f8d9028e6f4f1 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 After commit "s5p-mfc: Fix clock management in s5p_mfc_release function" all clocks related functions are called only when MFC device is really available, so there is no additional check needed for NULL gate clocks. This patch simplifies the code and kills IS_ERR_OR_NULL macro usage. Signed-off-by: Marek Szyprowski --- drivers/media/platform/s5p-mfc/s5p_mfc_pm.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 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_pm.c b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c index 11a918eb7564..b514584cf00d 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c @@ -91,16 +91,12 @@ void s5p_mfc_final_pm(struct s5p_mfc_dev *dev) int s5p_mfc_clock_on(void) { - int ret = 0; - atomic_inc(&clk_ref); mfc_debug(3, "+ %d\n", atomic_read(&clk_ref)); if (!pm->use_clock_gating) return 0; - if (!IS_ERR_OR_NULL(pm->clock_gate)) - ret = clk_enable(pm->clock_gate); - return ret; + return clk_enable(pm->clock_gate); } void s5p_mfc_clock_off(void) @@ -110,8 +106,7 @@ void s5p_mfc_clock_off(void) if (!pm->use_clock_gating) return; - if (!IS_ERR_OR_NULL(pm->clock_gate)) - clk_disable(pm->clock_gate); + clk_disable(pm->clock_gate); } int s5p_mfc_power_on(void) @@ -122,14 +117,14 @@ int s5p_mfc_power_on(void) if (ret) return ret; - if (!pm->use_clock_gating && !IS_ERR_OR_NULL(pm->clock_gate)) + if (!pm->use_clock_gating) ret = clk_enable(pm->clock_gate); return ret; } int s5p_mfc_power_off(void) { - if (!pm->use_clock_gating && !IS_ERR_OR_NULL(pm->clock_gate)) + if (!pm->use_clock_gating) clk_disable(pm->clock_gate); return pm_runtime_put_sync(pm->device); }