From patchwork Tue Feb 6 21:24:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10204169 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 6D5D360247 for ; Tue, 6 Feb 2018 21:24:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60EEB28AE7 for ; Tue, 6 Feb 2018 21:24:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55A1528B23; Tue, 6 Feb 2018 21:24:39 +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 096EC28AE7 for ; Tue, 6 Feb 2018 21:24:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 983016E506; Tue, 6 Feb 2018 21:24:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A9E06E506 for ; Tue, 6 Feb 2018 21:24:36 +0000 (UTC) Received: from [192.168.1.2] ([92.225.242.179]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MejX6-1eL16d1hJQ-00ODHj; Tue, 06 Feb 2018 22:24:31 +0100 Subject: [PATCH 2/2] drm/tilcdc: panel: Use common error handling code in of_get_panel_info() From: SF Markus Elfring To: dri-devel@lists.freedesktop.org, David Airlie , Jyri Sarha , Tomi Valkeinen References: Message-ID: <23b2cf6c-7b69-9ade-d97a-18af0c6eb73f@users.sourceforge.net> Date: Tue, 6 Feb 2018 22:24:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K0:hROBHCJc7ytEzg20lpTU/QHETK/yEQxUE+C2pPVE7V94bGzOQsb GMo/7+ZvCypiZQ16AWaASCx+G9dYsEIOELy+s5trSupgeawrIKgLoIWUmD61qv0DEjnnBwa k7szwZOXdxkpv9ao7zG22RZVXOBIlTw3X08SeO4V3XG3m4HY1NSM16Xo1KHtdmLX6ECB2Qc hsVtCm8Wr7NFtaj+e2tjQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:bd8Oita7dVU=:XIfx3qUcOIjwtTPRs6E9rG zWBvRCPS68JNsxZdIG5J60FhaJaXtFPF4gZj1GeoPykFWnrxdbXVlw2yP7EAZd20l/RLBgtp3 7nvIMaX+/XcYFqrsSYcGtTjR20SoterhcJe0NLMorqTVDhO3mJl+xCbubULgiySnnlsaSgEPR VBnYkO6d/I8lDhlTcJ8S6WRopL2XZ18gdm/nnIypozZgHzvWbunl3y1MfvXr64Tb444LRoxEG 5IyEIBPqzNpdhdM8MzKeMB9M2xIDmikgpOrkNKHgtkrTMvSzLb4k0+PfL7/i2pC3rvoGorbFz 7Unsf71lD934v4Onlgtttjy929Z2Aw0itlojy2LiPNOkbkvBJEeIavRjcMrN3FvBBBOHZfXis 5tuPc4s8kfU/ka8NIdUXxfKxTKHrIYyqjCLHIyfdosRgnjazW+VXsV5+B/3aaLj8mCGWShSs7 KlMm2UiHzSGueG4LnVyaUPx/O1bsENUUk7YIQm/4NKMmX1TzEOrYpFiIc2zh/7dKwGJVRHqS4 8GkpGeWmVwtSChVITKrHCOOCgwgnhkSK9lD7RGwQvonj5Z+k189aKbt8LODkDT8CUY9+HKx46 Z/zlTw9E7MaIBrCH90PvJTNcnFNnO8/ExbXz32I3UbHs9fNCrVfK+CB31QTzMUu3/AWb3qyPG 08jnNMhoY6jKBberVJbO9kwA/giEjGSfR9Rs77gJMFkxNNval+AhLhzovOOyiYUxoBeMhYpil lG2i2D36n3WULio4EnbhsCw0HynZ3VXGwm2HzSAMA+XLyWZAKPZoH6fmX9OsiOo6hGnWX7t61 dBXRTpiBOy/yP4KB+Y9NndJML7yyiqgKNhFi3ppLrEjqPPZzqs= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Tue, 6 Feb 2018 22:10:11 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. Signed-off-by: Markus Elfring --- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index 0b6aa95aec89..cf9ca16fee81 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c @@ -289,10 +289,8 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np) } info = kzalloc(sizeof(*info), GFP_KERNEL); - if (!info) { - of_node_put(info_np); - return NULL; - } + if (!info) + goto put_node; ret |= of_property_read_u32(info_np, "ac-bias", &info->ac_bias); ret |= of_property_read_u32(info_np, "ac-bias-intrpt", &info->ac_bias_intrpt); @@ -311,11 +309,11 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np) if (ret) { pr_err("%s: error reading panel-info properties\n", __func__); kfree(info); - of_node_put(info_np); - return NULL; + info = NULL; } - of_node_put(info_np); +put_node: + of_node_put(info_np); return info; }