From patchwork Tue Oct 10 08:43:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Chevallier X-Patchwork-Id: 9995341 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 F1A1660230 for ; Tue, 10 Oct 2017 08:54:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4C002838B for ; Tue, 10 Oct 2017 08:54:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9BB82839C; Tue, 10 Oct 2017 08:54:12 +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,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 0A8C72838B for ; Tue, 10 Oct 2017 08:54:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755272AbdJJIyL (ORCPT ); Tue, 10 Oct 2017 04:54:11 -0400 Received: from idris.smile.fr ([91.216.209.19]:50191 "EHLO idris.smile.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751398AbdJJIyK (ORCPT ); Tue, 10 Oct 2017 04:54:10 -0400 X-Greylist: delayed 594 seconds by postgrey-1.27 at vger.kernel.org; Tue, 10 Oct 2017 04:54:10 EDT Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id D82D81EE2735; Tue, 10 Oct 2017 10:44:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7A80ry4NVfzf; Tue, 10 Oct 2017 10:44:15 +0200 (CEST) Received: from smile-e5570.sigfox.io (unknown [217.114.201.133]) by idris.smile.fr (Postfix) with ESMTPSA id A2ED51EE2701; Tue, 10 Oct 2017 10:44:15 +0200 (CEST) From: Maxime Chevallier To: linux-spi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, broonie@kernel.org, gregory.clement@free-electrons.com, miquel.raynal@free-electrons.com, Maxime Chevallier Subject: [PATCH 1/2] spi: a3700: Return correct value on timeout detection Date: Tue, 10 Oct 2017 10:43:17 +0200 Message-Id: <1507624998-31425-1-git-send-email-maxime.chevallier@smile.fr> X-Mailer: git-send-email 2.1.4 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 When waiting for transfer completion, a3700_spi_wait_completion returns a boolean indicating if a timeout occurred. The function was returning 'true' everytime, failing to detect any timeout. This patch makes it return 'false' when a timeout is reached. Signed-off-by: Maxime Chevallier --- drivers/spi/spi-armada-3700.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-armada-3700.c b/drivers/spi/spi-armada-3700.c index 9172cb2..568e1c6 100644 --- a/drivers/spi/spi-armada-3700.c +++ b/drivers/spi/spi-armada-3700.c @@ -387,7 +387,8 @@ static bool a3700_spi_wait_completion(struct spi_device *spi) spireg_write(a3700_spi, A3700_SPI_INT_MASK_REG, 0); - return true; + /* Timeout was reached */ + return false; } static bool a3700_spi_transfer_wait(struct spi_device *spi,