From patchwork Sun Sep 4 07:59:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9312413 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 EA9B6600CA for ; Sun, 4 Sep 2016 08:07:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC5FF287DA for ; Sun, 4 Sep 2016 08:07:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D136A288F0; Sun, 4 Sep 2016 08:07:37 +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.4 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 8B815287DA for ; Sun, 4 Sep 2016 08:07:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbcIDIHg (ORCPT ); Sun, 4 Sep 2016 04:07:36 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35413 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752106AbcIDIHd (ORCPT ); Sun, 4 Sep 2016 04:07:33 -0400 Received: by mail-wm0-f66.google.com with SMTP id c133so8695338wmd.2 for ; Sun, 04 Sep 2016 01:07:32 -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=j4XV54XPAJlvdHZG0/fUpzEdROE9B4J4V/x3p9AxU6s=; b=mf+0p7w+gBXbGw2JHwocicB5VGNFsq0x3Ug31MRrEypl3zyQB3alDnc3K7b0ki5Jx2 Wq4P3+aylqjHzAp+l1uwmLtTlLrQ8ghRC4V17xndSpjInauy9ydIimegSWzrzm9x0v5p GITcOaIdq6FrQu+c6JAH8sIBP0UuJhm0PQ0zWlaYoduRDBBX3jLCST2Gs2Y/2+QbWLP8 L8iiHnhMzdX42j9k/JrW4dGRDj3e8pfajTx2MseRcFBbF6nciekwYSrybErZf6ri6chR erg5kaQdfn3fNqCbmv5nzBaRl4V6uXQM2K+Am/lzb8QNZ6HQhP1vTLYPEhGVv/JzVTPP Hemw== 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=j4XV54XPAJlvdHZG0/fUpzEdROE9B4J4V/x3p9AxU6s=; b=lWVCztNdndtvwOsjkNAkuSqZ2DjuyEkrIk/A++BBJIkI57ej319afgzF4053YtWr9d rgPZHHKRL0z6tNQCm2JV5ZcgFZ47SasYmQKqv0HtrQv2pF72SxuGigY6K/yPbmcYUB2J j96xzEXAT/ZGfRqsMAC1jzjTTJfnLuV9gRc79PygexAZO2kEcXuC1hH3d/8/v1ZRTDWj N9QmOoq2G870MHDIm7ClBk97gnD/el+MT259WvyAynXbyjUdT6MzGgQ4kBp/H8tiGlIW du8Tlhcy+8/PY+MPdVzK1KrITgIdDh6LdyAsn7aEYV2tQlgya5tdxdWN1xB8V2LL4Afq g3ng== X-Gm-Message-State: AE9vXwNDwJlhQPqAhq7/Lfm2Kpa3murQcDvjcHbvWhr/KOBAzhCTu6PqaxOhZ5Tgf7iyAw== X-Received: by 10.28.15.3 with SMTP id 3mr9888333wmp.31.1472976451837; Sun, 04 Sep 2016 01:07:31 -0700 (PDT) Received: from ?IPv6:2003:62:5f43:9500:c1f5:c528:a3d:f8c4? (p200300625F439500C1F5C5280A3DF8C4.dip0.t-ipconnect.de. [2003:62:5f43:9500:c1f5:c528:a3d:f8c4]) by smtp.googlemail.com with ESMTPSA id yt4sm19843879wjc.48.2016.09.04.01.07.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Sep 2016 01:07:31 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH v2 07/18] spi: fsl-espi: fix status handling in fsl_espi_do_one_msg To: Mark Brown References: Cc: "linux-spi@vger.kernel.org" Message-ID: <5153add7-b1b8-8634-3547-b048225330a5@gmail.com> Date: Sun, 4 Sep 2016 09:59:23 +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 --- v2: - rebased --- 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 5f01b65..6b60f7b 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)