From patchwork Tue Oct 24 08:49:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10023735 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CD5960381 for ; Tue, 24 Oct 2017 08:50:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BA57289B0 for ; Tue, 24 Oct 2017 08:50:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 507F6289B3; Tue, 24 Oct 2017 08:50:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DDF90289B0 for ; Tue, 24 Oct 2017 08:50:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC2606E3DB; Tue, 24 Oct 2017 08:50:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 133902 seconds by postgrey-1.35 at gabe; Tue, 24 Oct 2017 08:50:03 UTC Received: from mout.web.de (mout.web.de [217.72.192.78]) by gabe.freedesktop.org (Postfix) with ESMTPS id 502706E3DB for ; Tue, 24 Oct 2017 08:50:02 +0000 (UTC) Received: from [192.168.1.3] ([92.227.245.169]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MYeuk-1dkFJA0g7O-00VNk1; Tue, 24 Oct 2017 10:49:54 +0200 Subject: [PATCH 1/3] drm/exynos/dsi: Use common error handling code in exynos_dsi_enable() From: SF Markus Elfring To: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, David Airlie , Inki Dae , Joonyoung Shim , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Seung-Woo Kim References: <7d4cdb43-432c-c67a-5d3f-c37bd604f539@users.sourceforge.net> Message-ID: <9028478a-a00d-6fcd-0286-b8daefa8c912@users.sourceforge.net> Date: Tue, 24 Oct 2017 10:49:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <7d4cdb43-432c-c67a-5d3f-c37bd604f539@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:RpIQDUsHSFeGLl2hmnjxM2aCxIM0ICFCAZivDGoJmmY0Hp5GQi/ cXchQmOTmm6CTiWd8rU2k1rtY3aziwtHxnYcgX2b9R37EO56MHh10tOMe+hRD/ijSqeVggI gUATbLg45PL8hE2R5eOCeaSWlcfKHOLXNIEKuovW7ditb0KPPElK1bs8jMNTBGPqPdjTRSl pMLmm8M2EDhDC632Lo8gw== X-UI-Out-Filterresults: notjunk:1; V01:K0:H+4s3pM6AfI=:wLt1p/3shttSGo4Ugr6CLi Mwzeeq69BSnnrjku/Y98+CFJR7GVgzUU30ibWfrKtn6l0MqSqsU+1v0v97yt+qXXaz1CS1pmF unviSP7cJqbUycNbZBE4qVoeXRNG59Sk85T566zCl1lu8bZnbOuSgusZX+lSbv40j0e16shDC x4MFv8x+fQe11HTrRfVWUQWvebk4uHOSycFUNLpXVOY3mqbmBaKQjRDaFJ8O8d4ZKOF2E0aY+ flIufqfrPIRnznLZPQilH4LHjJ9gNjq9kP2KaJWNgLCbQunXMPjotICM+4Lc84BDj+sbsOJIE lnzpyq6ZBTlidBEr/hcHjDJMO+qWo1TnsMT5qvAQ10q1q4q35cf0RngWQErpxtwiZjIQYXo5R PwWodkwnK6/qUkFIZStU0jYvqZ0zNCFhSQW46YxsI81eMN8xwkaGrh3Nk/3dlQn1kH5NDZeqF d7HdtxVSOEgw+BLHzrZUPxUK3y0EIfBv5ma5xrohUdZaNLtsNNcoZbZg79LZVzPyAK1HeoUBv ttnvroxfhiWKnHCeDVpjqVlSoSRH9OQhCYlQLUFxQTe4SWs2DwFrDwyJHBMPp46+nTIB4+h8D 9PtD9D/FQoUnJJk/1AyhF68NU1IXFTw45/URR6oi99lAdQNoafN2Vb2gM8ttUS/H+bQ3KwJWU 9Vi1IGzR95U3fSH0kAARLvp1VXeRJfaCRr4LbvoKzmOjXKF8DN13cA+6bsIxIabANGnhENwO1 sIhZzWiv4Rnaem5QLBRfKQiJsJdkpEUjxG0vQYSjZoXZ0qXYGoOURys+RwFRyXn3NK20IDs5R QSkYJKZ+6HvbtAxkwAZZM8bagAzL5ROz4QCkg6AtuiFd1hIstA= Cc: kernel-janitors@vger.kernel.org, LKML 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Tue, 24 Oct 2017 09:32:18 +0200 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 7904ffa9abfb..ba5fb49c5491 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1389,8 +1389,7 @@ static void exynos_dsi_enable(struct drm_encoder *encoder) ret = drm_panel_prepare(dsi->panel); if (ret < 0) { dsi->state &= ~DSIM_STATE_ENABLED; - pm_runtime_put_sync(dsi->dev); - return; + goto put_sync; } exynos_dsi_set_display_mode(dsi); @@ -1401,11 +1400,14 @@ static void exynos_dsi_enable(struct drm_encoder *encoder) dsi->state &= ~DSIM_STATE_ENABLED; exynos_dsi_set_display_enable(dsi, false); drm_panel_unprepare(dsi->panel); - pm_runtime_put_sync(dsi->dev); - return; + goto put_sync; } dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE; + return; + +put_sync: + pm_runtime_put_sync(dsi->dev); } static void exynos_dsi_disable(struct drm_encoder *encoder)