From patchwork Mon May 16 06:28:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9098471 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 61D90BF29F for ; Mon, 16 May 2016 06:29:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9281F20172 for ; Mon, 16 May 2016 06:29:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A3D2A20166 for ; Mon, 16 May 2016 06:29:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751503AbcEPG3J (ORCPT ); Mon, 16 May 2016 02:29:09 -0400 Received: from mout.web.de ([212.227.17.12]:53140 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbcEPG3H (ORCPT ); Mon, 16 May 2016 02:29:07 -0400 Received: from [192.168.1.2] ([78.48.32.23]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LkhFg-1bcdEe2qyy-00aSNG; Mon, 16 May 2016 08:29:00 +0200 Subject: [PATCH 2/2] mfd: twl-core: Refactoring for add_numbered_child() To: Lee Jones , Tony Lindgren , linux-omap@vger.kernel.org References: <566ABCD9.1060404@users.sourceforge.net> <5682D228.7070902@users.sourceforge.net> <20160111082922.GB14104@x1> <05b7db2a-437a-60ac-d289-71d2150e7f5f@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: Date: Mon, 16 May 2016 08:28:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <05b7db2a-437a-60ac-d289-71d2150e7f5f@users.sourceforge.net> X-Provags-ID: V03:K0:e02uadUNazxsuNcmP0t8RXVPtStWahdRsTbt+li872ImJOigDaJ 5jRd3GayqcXfM7/PYKv7SHNslKVpNyaFiyaCVn3n9DtWvtA/jj6skHgXPBnrUpPx0HkHpFw YlvgnNv5P+Fgb9UgaJmLAyZ0Uv1di2rBZoIfKSuzGbD21rR3Wjar6/rMjke/eiWiP4x7Dpc ze5zDCQK35AM0Vhts6xLg== X-UI-Out-Filterresults: notjunk:1; V01:K0:7GtHNvU0RuM=:Jwk/oSLnp05k7svU6BLmIz F+bRxCZsBLod3SNHq+guH6SoXlRfKj6E1WcfVz76wz9QH04NIJmVO58925EFBnqhY86vfiohJ 7Fyu5gt1mWXZfD32B/sYTBs09indC6um3h+foa6aocQj6M0iHNW0B8AZw+oBUnRNKG4ggaC/v h/7B2QNnJagX2Zb2ZWpI0WjgI6vf27jToecAq5vVYXfd7+CpB1R+yw3nnCGSpn0xVrc4fsAoS lR612AGBLXsZ6fFRn/MKBthUawlpNC3fapiyD2VbBqhz2DxlAQ/YRK3HRe1R8DWTqEmh2LCdr Lbm+x1r8cB+OEFe6g5vYCV+f/V/Z6+HB95Xs48JHWkcSp4W+aQJU+StL/Uvb85cOT5A11yFAA HyEQdnBmwRRxndERls79zseb+QPv/B64Q1is405Qje0t0gU8dB+QBnizHbARbYpJvbVsk1PRR n5TNqGF4o9RW2YzOcx8aZOaP4ufBqGajlmDIOBDCp3dBAJI+7CIQm3jRdMrqsePYIx0aAfwgT +shBCyzaEYKSTdIJv0EuKXU06ZWbTk7Hlyhvza8fbqezbGiV/eETHyZJG/HFpOjiuL6jXSY7d QtsRaoTgZvy7VYSyN+PF4ken6YrKMcvpcC/ch2bmOUKQLD3FUNpehHFHumFAl9CplgoVb9peZ O0bUmv+ROsX/fLWNvusgUdhxOD3xOkUNnVrmpTyL5JUKh6clDKIvcGpXGUZoPd4jXf9QWp33y yUJkTB+WpXCaUmrtQm/dVT6fWqXxIMM8hYQfmTFT3AvRUmo18BNYjdwZMZhrbWrJfL6Fn0Edf jR5+JIUcdjMpEBZ1sTzYGQ7EeJG1A== Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 15 May 2016 19:50:55 +0200 Adjust jump targets according to the Linux coding style convention. Another check for the variable "status" can be omitted then at the end. Signed-off-by: Markus Elfring Acked-by: Lee Jones --- drivers/mfd/twl-core.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index dc34e69..3e4f4e4 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -635,7 +635,7 @@ add_numbered_child(unsigned mod_no, const char *name, int num, status = platform_device_add_data(pdev, pdata, pdata_len); if (status < 0) { dev_dbg(&pdev->dev, "can't add platform_data\n"); - goto err; + goto put_device; } } @@ -648,21 +648,20 @@ add_numbered_child(unsigned mod_no, const char *name, int num, status = platform_device_add_resources(pdev, r, irq1 ? 2 : 1); if (status < 0) { dev_dbg(&pdev->dev, "can't add irqs\n"); - goto err; + goto put_device; } } status = platform_device_add(pdev); - if (status == 0) - device_init_wakeup(&pdev->dev, can_wakeup); + if (status) + goto put_device; -err: - if (status < 0) { - platform_device_put(pdev); - dev_err(&twl->client->dev, "can't add %s dev\n", name); - return ERR_PTR(status); - } + device_init_wakeup(&pdev->dev, can_wakeup); return &pdev->dev; +put_device: + platform_device_put(pdev); + dev_err(&twl->client->dev, "can't add %s dev\n", name); + return ERR_PTR(status); } static inline struct device *add_child(unsigned mod_no, const char *name,