From patchwork Sat Sep 17 13:43:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9337093 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 505FE6089F for ; Sat, 17 Sep 2016 13:44:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4239E2968D for ; Sat, 17 Sep 2016 13:44:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3549129693; Sat, 17 Sep 2016 13:44:47 +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=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D855F2968D for ; Sat, 17 Sep 2016 13:44:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751544AbcIQNoq (ORCPT ); Sat, 17 Sep 2016 09:44:46 -0400 Received: from mout.web.de ([212.227.15.3]:64163 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751301AbcIQNop (ORCPT ); Sat, 17 Sep 2016 09:44:45 -0400 Received: from [192.168.178.152] ([91.50.213.247]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0Le4fk-1bDLI33n4O-00prQJ; Sat, 17 Sep 2016 15:44:39 +0200 From: Heiner Kallweit Subject: [PATCH 2/4] spi: fsl-espi: simplify of_fsl_espi_probe To: Mark Brown References: <1d67ce99-42ea-c816-da35-e64575cca8ff@web.de> Cc: "linux-spi@vger.kernel.org" Message-ID: <5bfd3921-5bb6-b9c3-dc64-3882491bba13@web.de> Date: Sat, 17 Sep 2016 15:43:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1d67ce99-42ea-c816-da35-e64575cca8ff@web.de> X-Provags-ID: V03:K0:yN9HSRqdZ/vTxMwcZeJo1C5iiJKi3pzaE3hL6+SIOr+8T878gL2 OQCr9PzHUtgVJCrfHcuzQSG1O72aIWbV5uSTnRHtdI/qJDk/4sXg5CUrTcmr+w/iXnM4ctR Ch2GfxUE8PXJWMAXpOsgut1P+V3m0JPbdxA0tXkzp+lrwgUdgQxJICTT0D1QE0WZYrjM0o9 kGFaMEvy6vwyS06Y7tnDg== X-UI-Out-Filterresults: notjunk:1; V01:K0:ihnJsOVBP04=:IGZpazNL00hd973nZUf5H6 2kxUWmxqCCYq021b352ssEN+GFtB4dfJymYYVWW/+AFJ3GRiMthRIivd+nhSE4sYZzaSPzjJt v05uMaOcA2c6NuZikf9lrLlqaQlrgfuaZ5Ev3hLE1xPz8gR40VJ+zG/nboace4aDOEwZrYVfi AQbxZGzgdgwi2+qY4iCqUXfAwOtxwNcSICWmwSJwv+Ky9o2bBmsYUF41jbU/A21rv+lfaeBKr B+QAX+LokfOsXgaOnnc6HCF7Q4e/PU9nIkxRWfhklbPjZNxlD7AfWmbBi4152Vj8Yj9Zus73n 5MXZNC4bR3JXqFnJp2JqkIKno7KxwbkcAnxNe6Fr4Rni4oXUWe3JPGzOul2TOblNDPMreadL4 XM6Oj/PYDTRoh49KiGeLg8C9zkQhVZOiUibYYP0RnlwsrvaglfnlAHwOeFudiwnsONwmFugkK amFKnQPXKxTdl/1MrjZCxKew8WDbA6gzOsYW8ifhTQkkdqopFCGbPITfQiRQWo6uqyR+yT59Z UcsuSZYvhpfQ5VJD4B/5Cj9D6bmXNSmB5VbknlUotSdUqHoxqvv5R/XnXi+55yioejgOk6T3X fmKn1nXqdeEgnGjK69893B1E19Y+p7mGi/6WfOpRp8efKAJOmnSudX30MjyQVPyR0B0JPjlq+ hu9Nz+5x0sw2m5dVA6oZy9vmuZMMtmLADFFbNMb8NT6FbmwKp5y5mZoJKpBXk7VhiIQA5wujZ u+cAGfJaEGVlRBHhmktMIz1v9AvtR9bi110GwGDa+kDfzyBQQbD9sDwVBZiXC1Kdd2MF9j88h upj9s/I Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simplify of_fsl_espi_probe. Signed-off-by: Heiner Kallweit --- drivers/spi/spi-fsl-espi.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index 4f9d9ec..dee3f82 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -685,7 +685,7 @@ static int of_fsl_espi_probe(struct platform_device *ofdev) struct spi_master *master; struct resource mem; unsigned int irq; - int ret = -ENOMEM; + int ret; ret = of_mpc8xxx_spi_probe(ofdev); if (ret) @@ -693,28 +693,21 @@ static int of_fsl_espi_probe(struct platform_device *ofdev) ret = of_fsl_espi_get_chipselects(dev); if (ret) - goto err; + return ret; ret = of_address_to_resource(np, 0, &mem); if (ret) - goto err; + return ret; irq = irq_of_parse_and_map(np, 0); - if (!irq) { - ret = -EINVAL; - goto err; - } + if (!irq) + return -EINVAL; master = fsl_espi_probe(dev, &mem, irq); - if (IS_ERR(master)) { - ret = PTR_ERR(master); - goto err; - } + if (IS_ERR(master)) + return PTR_ERR(master); return 0; - -err: - return ret; } static int of_fsl_espi_remove(struct platform_device *dev)