From patchwork Thu Aug 25 04:47:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9298671 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 88DFD60757 for ; Thu, 25 Aug 2016 04:55:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78C2E291C0 for ; Thu, 25 Aug 2016 04:55:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D914291C7; Thu, 25 Aug 2016 04:55:58 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 B6C3A291C0 for ; Thu, 25 Aug 2016 04:55:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756258AbcHYEzi (ORCPT ); Thu, 25 Aug 2016 00:55:38 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33998 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754005AbcHYExV (ORCPT ); Thu, 25 Aug 2016 00:53:21 -0400 Received: by mail-wm0-f66.google.com with SMTP id q128so5638653wma.1 for ; Wed, 24 Aug 2016 21:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=W6UYEcOvRzqjq3rR7DLqvQ9itLoa2OCfR/w6ttDsJ84=; b=GJlyyRri2hMb7zjtAUqrcT2NtHT2BIMqvmymz9Yni8RQ1DdHzuj8eoSdl4oCGXM8wp JB5NpbfNNtxctRs7zYiN5fOGQwyyX3lKVxpyPfuCmDW3rsuYIplYQZKo+IVDJMlDHm9L 6dDNj96oXNal2lh4loAEiVyKlIiewgOnNjOncNFHaqNo/718+SAuzh3qd1JDWDKcjQQy PO8kQsnD82XpEO7FjEYL9nmqDDSgfwgU2fVRdo3gJad2LhoFYKsTiY6x7yN9FL38zuyP 97pGrRaSwtdmX1BK9ZjdJw/fW/EmwsCYWBTxsRd4SvUUHA9ZS2fkKL4YQ5K401osIWrv 93KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=W6UYEcOvRzqjq3rR7DLqvQ9itLoa2OCfR/w6ttDsJ84=; b=JFalun/njtSVJV+orM1ssge0VWVBdrX7sPLVKB9AvYMST/n+m3vs3vMLIsbpHt3zam yLDGH2JgfdlxLm5pKZo0OA2ypLROuKOzaaddM1+Jy0RnzLoxvRCsnYGyFIjyO6KPlRdI jO84tmGBTGZYv4qDwxI8YI+1Kc5F65bzkfAkEiRUL3zCkWdSnxaTPjATr9lnwtcGneCr QVN0SGnLFDzHJc+K53bmQb0hE4Q2J58sU/iQe7XIHCuX7pX8dLMTE3a+KM91yC8FhBz7 qbD0fo9zFCMEtQotHe5dkqcsFdlE9lqnL2xVOC9gPX50OHwsVjPmIhbEE76yXXQ5JXVF GMGQ== X-Gm-Message-State: AEkooutnGRg92JwcKKYmNJcXXRmUzB1+VqQD9Zv32iVAk94XUyO/JgWZkq5h/BFe5c4aEw== X-Received: by 10.194.235.69 with SMTP id uk5mr5398805wjc.53.1472100800179; Wed, 24 Aug 2016 21:53:20 -0700 (PDT) Received: from ?IPv6:2003:62:5f43:9500:dd82:2805:e44f:720e? (p200300625F439500DD822805E44F720E.dip0.t-ipconnect.de. [2003:62:5f43:9500:dd82:2805:e44f:720e]) by smtp.googlemail.com with ESMTPSA id g67sm13803402wme.5.2016.08.24.21.53.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Aug 2016 21:53:19 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH 10/23] spi: fsl-espi: fix status handling in fsl_espi_do_one_msg To: Mark Brown References: Cc: "linux-spi@vger.kernel.org" Message-ID: <212d80f1-e3d1-0065-7366-e509a30b9c6c@gmail.com> Date: Thu, 25 Aug 2016 06:47:35 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: 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 If an error occurred during message handling return this error instead of always returning 0 and align the code with the generic implementation in spi_transfer_one_message. Signed-off-by: Heiner Kallweit --- drivers/spi/spi-fsl-espi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index 68bf72a..c15d2bc 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -381,9 +381,12 @@ static int fsl_espi_do_one_msg(struct spi_master *master, ret = fsl_espi_rw_trans(m, &espi_trans, rx_buf); m->actual_length = espi_trans.actual_length; - m->status = ret; + if (m->status == -EINPROGRESS) + m->status = ret; + spi_finalize_current_message(master); - return 0; + + return ret; } static int fsl_espi_setup(struct spi_device *spi)