Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6136844imu; Wed, 30 Jan 2019 09:22:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN4H5UxOCMv5oRko2oCVyjYmhTUi9cje9v4hTXOcLUuLRKGWlNm76bMJL+NYFf4U2ZkCbWnl X-Received: by 2002:a63:413:: with SMTP id 19mr27877896pge.7.1548868967885; Wed, 30 Jan 2019 09:22:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548868967; cv=none; d=google.com; s=arc-20160816; b=hCODCwD4+VEo/Opjt1UGs1EyEt7eelKNEe47vJ9q+wYc1ZdFj2KJpaDyx+wIb2LHzq o/KASffCMP/iRxQEjCajakw77cDUwxQ8CKz3pUY6FQVL/nLV7STAjJwxZ4d8/ctnc4T6 zvZh2C+nG0qVNapt2BwVIeR122gTHgJhTUZ/YFTwTtwBdLEHuyqD/UwKBi7VhX7SjzgC jyBP4XtQVkzzL9QzXL2Y8OzERRmJLpDncmKj7WGEJDS9uvGMiLJzjxvcmwnvI1CnCSHA W7SoeLEwFIwZPDSjpPEY3cayruC6PgefAMEk2owwul59eZKeIXbuVfGTjMfWclT/hpb9 VlCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=6UEJPBpUxLm/mRaqKikupyxnKqDcrfE1mbYEAr8+Xwo=; b=UOWgxzKib+M+gaJjJJIjPSEKfMcvEVtLJJJTAQ5b5TYFiqqT1u+L0Ix/CYyeFRa7en xIEETL9aLXU5P4um+oXrCQ4TF1wZ23lojLnOxURJws+jXRg0QBbAk9IdFwH2c+JQAlPF SBdM8AZX3PtNTL/je8AaH8qa06/PcacBTsghbUB7gA+wwkuRYsTMBCvrQG6L6ZlMoqWv v1DL0lSYm0A4Tj78hm2B++l9GuJ+mQcqDKz/SRv3TIlWkzMt9YAqAHF/fzfmyO8fqDhk KvyXJymXt+bDVV0Y+1dp0PRKduTYg/t4pUiJ5FyaUrYtMVpmZG1yml7tI+LLr1dIRtnb 8p/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PMTX5C9Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x18si1901218pfm.39.2019.01.30.09.22.14; Wed, 30 Jan 2019 09:22:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PMTX5C9Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732416AbfA3RVL (ORCPT + 99 others); Wed, 30 Jan 2019 12:21:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:50652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfA3RVL (ORCPT ); Wed, 30 Jan 2019 12:21:11 -0500 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0761F20855; Wed, 30 Jan 2019 17:21:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548868870; bh=RQtcdk/R8L4tDjBvAw5e5DwzsQUK3bOrQIKxSFHlHu8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PMTX5C9QwHmQCdUbNV1tS5hkrkyl2TLbnUCvHPaqWu1H8n3ljG4z399fsxhxTKEee rXc+shwkMegZqMajh6yneZf6LR48ne6E0Dy8MgblH1OtaYWb7A0+EGpGnJ+sSSrhel b28LO+l/5kAj77HWehuXmCGELXTgwyT8oDWx1rAc= Date: Wed, 30 Jan 2019 18:21:00 +0100 From: Boris Brezillon To: Cc: , , , , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org Subject: Re: [PATCH 5/9] spi: atmel-quadspi: return appropriate error code Message-ID: <20190130182100.3429fa36@bbrezillon> In-Reply-To: <20190130150818.24902-6-tudor.ambarus@microchip.com> References: <20190130150818.24902-1-tudor.ambarus@microchip.com> <20190130150818.24902-6-tudor.ambarus@microchip.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 30 Jan 2019 15:08:38 +0000 wrote: > From: Tudor Ambarus > > Return -ENOTSUPP when atmel_qspi_find_mode() fails. Propagate > the error in atmel_qspi_exec_op(). > > Signed-off-by: Tudor Ambarus Reviewed-by: Boris Brezillon > --- > drivers/spi/atmel-quadspi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c > index 3643f0c851b0..e6de6e3d1345 100644 > --- a/drivers/spi/atmel-quadspi.c > +++ b/drivers/spi/atmel-quadspi.c > @@ -208,7 +208,7 @@ static int atmel_qspi_find_mode(const struct spi_mem_op *op) > if (atmel_qspi_is_compatible(op, &sama5d2_qspi_modes[i])) > return i; > > - return -1; > + return -ENOTSUPP; > } > > static bool atmel_qspi_supports_op(struct spi_mem *mem, > @@ -239,7 +239,7 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) > > mode = atmel_qspi_find_mode(op); > if (mode < 0) > - return -ENOTSUPP; > + return mode; > > ifr |= sama5d2_qspi_modes[mode].config; >