From nobody Sun Feb 8 02:56:13 2026 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B998D25575 for ; Sun, 4 Feb 2024 20:31:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707078695; cv=none; b=lsNeqsqYrNH6P/t0iES09alo/phMKybjBdkf3V6yRpL68LoSADggcmnaAiYvoxwdNqul+xdA8TBByZoeYgo7BEEbs2sJZjqvJLGEYK2VHslCfXgBpFS8QePbk7FTLQ/eiHwoMLGgG6zOrUfykd9EK6/AdX8HGS7dIL08HBBbirU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707078695; c=relaxed/simple; bh=MhE/DRokJGyxHoqiW1gqVDgK1hamRUWnqv9bb+Y9vPE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZOQSWxNvSXqd8uQRPY7tAhpg6sTN35Bnj+1/vqSyQuY1807SjW1RxSeJL/1TrabsDDkg6YXN0crGmivOiUEnbCSqtudsi6k96GO/bdbGwHA0j+P8cjoHBc7NEYL3adJ8KR5x9wQffbfQL7NNWna2XoCWhU+LOjxwoL8u2g7C6wc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-30.elisa-laajakaista.fi [88.113.26.30]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 6158c527-c39c-11ee-b972-005056bdfda7; Sun, 04 Feb 2024 22:31:31 +0200 (EET) From: andy.shevchenko@gmail.com To: Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Oltean , Minjie Du , Andy Shevchenko Subject: [PATCH v2 1/2] spi: fsl-dspi: Preserve error code returned by dmaengine_slave_config() Date: Sun, 4 Feb 2024 22:29:18 +0200 Message-ID: <20240204203127.1186621-2-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240204203127.1186621-1-andy.shevchenko@gmail.com> References: <20240204203127.1186621-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" dmaengine_slave_config() may return different error codes based on the circumstances. Preserve it instead of shadowing to -EINVAL. Suggested-by: Vladimir Oltean Signed-off-by: Andy Shevchenko Reviewed-by: Vladimir Oltean --- drivers/spi/spi-fsl-dspi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index c9eae046f66c..0b5ea7a7da71 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -542,7 +542,6 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys= _addr_t phy_addr) ret =3D dmaengine_slave_config(dma->chan_rx, &cfg); if (ret) { dev_err(dev, "can't configure rx dma channel\n"); - ret =3D -EINVAL; goto err_slave_config; } =20 @@ -550,7 +549,6 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys= _addr_t phy_addr) ret =3D dmaengine_slave_config(dma->chan_tx, &cfg); if (ret) { dev_err(dev, "can't configure tx dma channel\n"); - ret =3D -EINVAL; goto err_slave_config; } =20 --=20 2.43.0 From nobody Sun Feb 8 02:56:13 2026 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C97425627 for ; Sun, 4 Feb 2024 20:31:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707078696; cv=none; b=sD/AjuFg2xyrRrJS2qkCWLJg81L7CmpLB2oKxBMqydgDF4mpKKgSADH9w82RxaN9lFlmkR2RfW9lgLHYxPxKOd15FefDTPbf2XABS70PiNyBWyRnChjlOPmQCC47oBuqGEGj/Y5zwl8+hTQeCLUA2oWZz2J+rge6Jw9JX0CAcho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707078696; c=relaxed/simple; bh=XLDi5/MAVt+bIe/YQBcfp7eO7Bz7U9KmRyihYGtcmdA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MBpP4bASHLFs58a/OecaW5H4jpCkllTrB2C1MVsl80k8RuEIbYm0MlfKZ7E332OXzz6NKah8209+UDuhfK8zynF7iohXl+PZi34ocLCKSuDZmj7hR/hocswxdwxqwLm/hevvq/H3nluD2Q7Vz2Mn15Yeg+1aRE/jpxugWS6oPZY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-30.elisa-laajakaista.fi [88.113.26.30]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id 61e52b80-c39c-11ee-b3cf-005056bd6ce9; Sun, 04 Feb 2024 22:31:31 +0200 (EET) From: andy.shevchenko@gmail.com To: Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Oltean , Minjie Du , Andy Shevchenko Subject: [PATCH v2 2/2] spi: fsl-dspi: Unify error messaging in dspi_request_dma() Date: Sun, 4 Feb 2024 22:29:19 +0200 Message-ID: <20240204203127.1186621-3-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240204203127.1186621-1-andy.shevchenko@gmail.com> References: <20240204203127.1186621-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use dev_err_probe() for all messages in dspi_request_dma() for the sake of making them uniform. While at it, fix indentation issue reported by Vladimir Oltean. Signed-off-by: Andy Shevchenko Reviewed-by: Vladimir Oltean --- drivers/spi/spi-fsl-dspi.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 0b5ea7a7da71..38defdcf9370 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -502,15 +502,12 @@ static int dspi_request_dma(struct fsl_dspi *dspi, ph= ys_addr_t phy_addr) return -ENOMEM; =20 dma->chan_rx =3D dma_request_chan(dev, "rx"); - if (IS_ERR(dma->chan_rx)) { - return dev_err_probe(dev, PTR_ERR(dma->chan_rx), - "rx dma channel not available\n"); - } + if (IS_ERR(dma->chan_rx)) + return dev_err_probe(dev, PTR_ERR(dma->chan_rx), "rx dma channel not ava= ilable\n"); =20 dma->chan_tx =3D dma_request_chan(dev, "tx"); if (IS_ERR(dma->chan_tx)) { - ret =3D PTR_ERR(dma->chan_tx); - dev_err_probe(dev, ret, "tx dma channel not available\n"); + ret =3D dev_err_probe(dev, PTR_ERR(dma->chan_tx), "tx dma channel not av= ailable\n"); goto err_tx_channel; } =20 @@ -541,14 +538,14 @@ static int dspi_request_dma(struct fsl_dspi *dspi, ph= ys_addr_t phy_addr) cfg.direction =3D DMA_DEV_TO_MEM; ret =3D dmaengine_slave_config(dma->chan_rx, &cfg); if (ret) { - dev_err(dev, "can't configure rx dma channel\n"); + dev_err_probe(dev, ret, "can't configure rx dma channel\n"); goto err_slave_config; } =20 cfg.direction =3D DMA_MEM_TO_DEV; ret =3D dmaengine_slave_config(dma->chan_tx, &cfg); if (ret) { - dev_err(dev, "can't configure tx dma channel\n"); + dev_err_probe(dev, ret, "can't configure tx dma channel\n"); goto err_slave_config; } =20 --=20 2.43.0