From patchwork Thu Nov 23 21:10:16 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: 10073335 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 5B7816056E for ; Thu, 23 Nov 2017 21:10:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ACAD2A011 for ; Thu, 23 Nov 2017 21:10:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CA762A01C; Thu, 23 Nov 2017 21:10:31 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 703F22A011 for ; Thu, 23 Nov 2017 21:10:30 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 466AB267393; Thu, 23 Nov 2017 22:10:29 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8A717267394; Thu, 23 Nov 2017 22:10:27 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.15.4]) by alsa0.perex.cz (Postfix) with ESMTP id 03267266F1C for ; Thu, 23 Nov 2017 22:10:25 +0100 (CET) Received: from [192.168.1.3] ([92.224.135.232]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MNt8d-1eEvgX3Pv1-007W7f; Thu, 23 Nov 2017 22:10:19 +0100 From: SF Markus Elfring To: alsa-devel@alsa-project.org, Jaroslav Kysela , Liam Girdwood , Mark Brown , Peter Ujfalusi , Takashi Iwai References: Message-ID: <54fbbfe9-ee59-c346-e22a-f059e1f2552f@users.sourceforge.net> Date: Thu, 23 Nov 2017 22:10:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:YHqkoZRnVeeOI+a0KWImPi8StWYDD+UP2yM/RUWOzthiEMzEIf2 IXjF9EDqIGc2PXL+9eUKpT1ThgkdpBpkyqkW4SnCvvoowv646Ej/FKxirHsbbcAFo9iAWO/ 2JiSvpzIUidy7LzwaLETLFMBnAeJd3+uZwr33t3R6MoJB3vo6oYQ4pjxi77ocG5X0umTHQj vcooUwJy578I6IM2XGheA== X-UI-Out-Filterresults: notjunk:1; V01:K0:kCqHjOfBVec=:6yPc2g9AxtPz+xEWHke0nA JVKywnaAM+jYKEL/cs5NmUAgRqb1IsT+nb+MI3hZWXQEcWKmwSgcl9GACx1fFwHZYRvMYi4b+ IoVTwpCa30+YoYIlBUuU/VQdAu+6OZOToR/gs5xP2ZJf308PMakgxSUPlZNkwX2YFilAcmEx6 g76YrKo5qbVACCAzaTqJ14JJgzSAiZtyUF0RSsvK0K6cpJRkVLSaI4Skg6YgJ+JJdwgeKeRTH 457XAafp9BJ+NI4TUESHVnedUeXQtMKTbde/OQUCvsQ/SrgKMeQJdIPeSaiWYDroKNvh8xmDD 0FlCUFgUlSLau4VLBoPwxEzErlhhBk1pJC0d7TVW8CyRIMANciwsaE9JWbjiEdadt0sWpaLvG CGYrGC6U+jyQ7xTYg9WBORbRtWcaDQAp97sGBhxTseuYNUJVKdVMQPLPi67CVz7SGqVBodM36 wNT/sR5RmvggfWxnK64dVappdDAVM2Su4ehfpMjP8o4vVaPq8hz7+8iQBqP+TGQk+oEx0w0vv B/sXCt3eAEzDl/fzWxqudte1cazphsrivy0kv5l22cG8EM7oPA4CElk4e3tYQe4/qoooyyuYQ WqB1nMMGnOc/Vzkul5/Zp7105yc47FReC2I3SmWNEBWBGnlKmY4HMmRRPfV1gGxlMLVwBKn3t nTb3o3/k2NzGKmVaC6wM3qyj1UpphqPgy/mCsGI3VhgsorOwjpyTgir/9+O8U2CA2A0I5oTb2 bSaX3jFao6p4v2oCHUb9w73F5kZOoOCe8yAzStziImA3cvlPtbZEniohkoZDnzPOGy3pxK4h0 saQl8KFDq/3yatO9ws9BVT6Ko7HSE0L56Fk3wVIH2nohr/wm5M= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 2/4] ASoC: twl4030: Use common error handling code in twl4030_get_pdata() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 23 Nov 2017 21:35:28 +0100 Add a jump target so that a bit of exception handling can be better reused in an if branch of this function. Signed-off-by: Markus Elfring --- sound/soc/codecs/twl4030.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 90691701b082..a1f0b45c83ca 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -239,11 +239,11 @@ static struct twl4030_codec_data *twl4030_get_pdata(struct snd_soc_codec *codec) pdata = devm_kzalloc(codec->dev, sizeof(struct twl4030_codec_data), GFP_KERNEL); - if (!pdata) { - of_node_put(twl4030_codec_node); - return NULL; - } + if (!pdata) + goto put_node; + twl4030_setup_pdata_of(pdata, twl4030_codec_node); +put_node: of_node_put(twl4030_codec_node); }