linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral
@ 2020-09-01 15:27 Krzysztof Kozlowski
  2020-09-01 15:27 ` [PATCH 02/11] spi: sprd: Simplify with dev_err_probe() Krzysztof Kozlowski
                   ` (11 more replies)
  0 siblings, 12 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski, stable

If dma_request_chan() for TX channel fails with EPROBE_DEFER, the RX
channel would not be released and on next re-probe it would be requested
second time.

Fixes: 386119bc7be9 ("spi: sprd: spi: sprd: Add DMA mode support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-sprd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c
index 6678f1cbc566..0443fec3a6ab 100644
--- a/drivers/spi/spi-sprd.c
+++ b/drivers/spi/spi-sprd.c
@@ -563,11 +563,11 @@ static int sprd_spi_dma_request(struct sprd_spi *ss)
 
 	ss->dma.dma_chan[SPRD_SPI_TX]  = dma_request_chan(ss->dev, "tx_chn");
 	if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_TX])) {
+		dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]);
 		if (PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]) == -EPROBE_DEFER)
 			return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
 
 		dev_err(ss->dev, "request TX DMA channel failed!\n");
-		dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]);
 		return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
 	}
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 02/11] spi: sprd: Simplify with dev_err_probe()
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
@ 2020-09-01 15:27 ` Krzysztof Kozlowski
  2020-09-08  7:27   ` Chunyan Zhang
  2020-09-08 13:22   ` Mark Brown
  2020-09-01 15:27 ` [PATCH 03/11] spi: atmel: " Krzysztof Kozlowski
                   ` (10 subsequent siblings)
  11 siblings, 2 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-sprd-adi.c |  5 +----
 drivers/spi/spi-sprd.c     | 17 +++++------------
 2 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c
index 127b8bd25831..392ec5cfa3d6 100644
--- a/drivers/spi/spi-sprd-adi.c
+++ b/drivers/spi/spi-sprd-adi.c
@@ -504,10 +504,7 @@ static int sprd_adi_probe(struct platform_device *pdev)
 			dev_info(&pdev->dev, "no hardware spinlock supplied\n");
 			break;
 		default:
-			dev_err(&pdev->dev,
-				"failed to find hwlock id, %d\n", ret);
-			fallthrough;
-		case -EPROBE_DEFER:
+			dev_err_probe(&pdev->dev, ret, "failed to find hwlock id\n");
 			goto put_ctlr;
 		}
 	}
diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c
index 0443fec3a6ab..635738f54c73 100644
--- a/drivers/spi/spi-sprd.c
+++ b/drivers/spi/spi-sprd.c
@@ -553,22 +553,15 @@ static int sprd_spi_dma_tx_config(struct sprd_spi *ss, struct spi_transfer *t)
 static int sprd_spi_dma_request(struct sprd_spi *ss)
 {
 	ss->dma.dma_chan[SPRD_SPI_RX] = dma_request_chan(ss->dev, "rx_chn");
-	if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_RX])) {
-		if (PTR_ERR(ss->dma.dma_chan[SPRD_SPI_RX]) == -EPROBE_DEFER)
-			return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_RX]);
-
-		dev_err(ss->dev, "request RX DMA channel failed!\n");
-		return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_RX]);
-	}
+	if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_RX]))
+		return dev_err_probe(ss->dev, PTR_ERR(ss->dma.dma_chan[SPRD_SPI_RX]),
+				     "request RX DMA channel failed!\n");
 
 	ss->dma.dma_chan[SPRD_SPI_TX]  = dma_request_chan(ss->dev, "tx_chn");
 	if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_TX])) {
 		dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]);
-		if (PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]) == -EPROBE_DEFER)
-			return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
-
-		dev_err(ss->dev, "request TX DMA channel failed!\n");
-		return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
+		return dev_err_probe(ss->dev, PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]),
+				     "request TX DMA channel failed!\n");
 	}
 
 	return 0;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 03/11] spi: atmel: Simplify with dev_err_probe()
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
  2020-09-01 15:27 ` [PATCH 02/11] spi: sprd: Simplify with dev_err_probe() Krzysztof Kozlowski
@ 2020-09-01 15:27 ` Krzysztof Kozlowski
  2020-09-01 19:12   ` Alexandre Belloni
  2020-09-01 15:27 ` [PATCH 04/11] spi: bcm2835: " Krzysztof Kozlowski
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-atmel.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 2cfe6253a784..7c68d5cdbdc6 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -513,9 +513,8 @@ static int atmel_spi_configure_dma(struct spi_master *master,
 
 	master->dma_tx = dma_request_chan(dev, "tx");
 	if (IS_ERR(master->dma_tx)) {
-		err = PTR_ERR(master->dma_tx);
-		if (err != -EPROBE_DEFER)
-			dev_err(dev, "No TX DMA channel, DMA is disabled\n");
+		err = dev_err_probe(dev, PTR_ERR(master->dma_tx),
+				    "No TX DMA channel, DMA is disabled\n");
 		goto error_clear;
 	}
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 04/11] spi: bcm2835: Simplify with dev_err_probe()
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
  2020-09-01 15:27 ` [PATCH 02/11] spi: sprd: Simplify with dev_err_probe() Krzysztof Kozlowski
  2020-09-01 15:27 ` [PATCH 03/11] spi: atmel: " Krzysztof Kozlowski
@ 2020-09-01 15:27 ` Krzysztof Kozlowski
  2020-09-01 16:08   ` Florian Fainelli
  2020-09-01 15:27 ` [PATCH 05/11] spi: cadence-quadspi: " Krzysztof Kozlowski
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-bcm2835.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index c45d76c848c8..5519f1eda238 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -1319,11 +1319,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
 
 	bs->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(bs->clk)) {
-		err = PTR_ERR(bs->clk);
-		if (err == -EPROBE_DEFER)
-			dev_dbg(&pdev->dev, "could not get clk: %d\n", err);
-		else
-			dev_err(&pdev->dev, "could not get clk: %d\n", err);
+		err = dev_err_probe(&pdev->dev, PTR_ERR(bs->clk),
+				    "could not get clk\n");
 		goto out_controller_put;
 	}
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 05/11] spi: cadence-quadspi: Simplify with dev_err_probe()
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2020-09-01 15:27 ` [PATCH 04/11] spi: bcm2835: " Krzysztof Kozlowski
@ 2020-09-01 15:27 ` Krzysztof Kozlowski
  2020-09-01 15:27 ` [PATCH 06/11] spi: spi-mux: " Krzysztof Kozlowski
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-cadence-quadspi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 508b219eabf8..cec4e89ab9b2 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1117,11 +1117,8 @@ static int cqspi_request_mmap_dma(struct cqspi_st *cqspi)
 	cqspi->rx_chan = dma_request_chan_by_mask(&mask);
 	if (IS_ERR(cqspi->rx_chan)) {
 		int ret = PTR_ERR(cqspi->rx_chan);
-
-		if (ret != -EPROBE_DEFER)
-			dev_err(&cqspi->pdev->dev, "No Rx DMA available\n");
 		cqspi->rx_chan = NULL;
-		return ret;
+		return dev_err_probe(&cqspi->pdev->dev, ret, "No Rx DMA available\n");
 	}
 	init_completion(&cqspi->rx_dma_complete);
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 06/11] spi: spi-mux: Simplify with dev_err_probe()
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2020-09-01 15:27 ` [PATCH 05/11] spi: cadence-quadspi: " Krzysztof Kozlowski
@ 2020-09-01 15:27 ` Krzysztof Kozlowski
  2020-09-01 15:27 ` [PATCH 07/11] spi: qcom-qspi: " Krzysztof Kozlowski
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-mux.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-mux.c b/drivers/spi/spi-mux.c
index cc9ef371db14..37dfc6e82804 100644
--- a/drivers/spi/spi-mux.c
+++ b/drivers/spi/spi-mux.c
@@ -139,9 +139,8 @@ static int spi_mux_probe(struct spi_device *spi)
 
 	priv->mux = devm_mux_control_get(&spi->dev, NULL);
 	if (IS_ERR(priv->mux)) {
-		ret = PTR_ERR(priv->mux);
-		if (ret != -EPROBE_DEFER)
-			dev_err(&spi->dev, "failed to get control-mux\n");
+		ret = dev_err_probe(&spi->dev, PTR_ERR(priv->mux),
+				    "failed to get control-mux\n");
 		goto err_put_ctlr;
 	}
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 07/11] spi: qcom-qspi: Simplify with dev_err_probe()
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2020-09-01 15:27 ` [PATCH 06/11] spi: spi-mux: " Krzysztof Kozlowski
@ 2020-09-01 15:27 ` Krzysztof Kozlowski
  2020-09-01 15:27 ` [PATCH 08/11] spi: stm32: " Krzysztof Kozlowski
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-qcom-qspi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c
index b8857a97f40a..f83755e292bb 100644
--- a/drivers/spi/spi-qcom-qspi.c
+++ b/drivers/spi/spi-qcom-qspi.c
@@ -495,9 +495,8 @@ static int qcom_qspi_probe(struct platform_device *pdev)
 
 	ctrl->icc_path_cpu_to_qspi = devm_of_icc_get(dev, "qspi-config");
 	if (IS_ERR(ctrl->icc_path_cpu_to_qspi)) {
-		ret = PTR_ERR(ctrl->icc_path_cpu_to_qspi);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "Failed to get cpu path: %d\n", ret);
+		ret = dev_err_probe(dev, PTR_ERR(ctrl->icc_path_cpu_to_qspi),
+				    "Failed to get cpu path\n");
 		goto exit_probe_master_put;
 	}
 	/* Set BW vote for register access */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 08/11] spi: stm32: Simplify with dev_err_probe()
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
                   ` (5 preceding siblings ...)
  2020-09-01 15:27 ` [PATCH 07/11] spi: qcom-qspi: " Krzysztof Kozlowski
@ 2020-09-01 15:27 ` Krzysztof Kozlowski
  2020-09-08 13:53   ` Alain Volmat
  2020-09-01 15:27 ` [PATCH 09/11] spi: synquacer: " Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-stm32.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index d4b33b358a31..f0e594b2fee4 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -1857,9 +1857,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
 
 	spi->irq = platform_get_irq(pdev, 0);
 	if (spi->irq <= 0) {
-		ret = spi->irq;
-		if (ret != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "failed to get irq: %d\n", ret);
+		ret = dev_err_probe(&pdev->dev, spi->irq, "failed to get irq\n");
 		goto err_master_put;
 	}
 	ret = devm_request_threaded_irq(&pdev->dev, spi->irq,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 09/11] spi: synquacer: Simplify with dev_err_probe()
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
                   ` (6 preceding siblings ...)
  2020-09-01 15:27 ` [PATCH 08/11] spi: stm32: " Krzysztof Kozlowski
@ 2020-09-01 15:27 ` Krzysztof Kozlowski
  2020-09-01 15:27 ` [PATCH 10/11] spi: tegra114: " Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-synquacer.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-synquacer.c b/drivers/spi/spi-synquacer.c
index ae17c99cce03..42e82dbe3d41 100644
--- a/drivers/spi/spi-synquacer.c
+++ b/drivers/spi/spi-synquacer.c
@@ -640,9 +640,8 @@ static int synquacer_spi_probe(struct platform_device *pdev)
 		}
 
 		if (IS_ERR(sspi->clk)) {
-			if (!(PTR_ERR(sspi->clk) == -EPROBE_DEFER))
-				dev_err(&pdev->dev, "clock not found\n");
-			ret = PTR_ERR(sspi->clk);
+			ret = dev_err_probe(&pdev->dev, PTR_ERR(sspi->clk),
+					    "clock not found\n");
 			goto put_spi;
 		}
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 10/11] spi: tegra114: Simplify with dev_err_probe()
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
                   ` (7 preceding siblings ...)
  2020-09-01 15:27 ` [PATCH 09/11] spi: synquacer: " Krzysztof Kozlowski
@ 2020-09-01 15:27 ` Krzysztof Kozlowski
  2020-09-01 15:27 ` [PATCH 11/11] spi: tegra20: " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-tegra114.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index c2c58871a947..ca6886aaa519 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -664,16 +664,11 @@ static int tegra_spi_init_dma_param(struct tegra_spi_data *tspi,
 	struct dma_chan *dma_chan;
 	u32 *dma_buf;
 	dma_addr_t dma_phys;
-	int ret;
 
 	dma_chan = dma_request_chan(tspi->dev, dma_to_memory ? "rx" : "tx");
-	if (IS_ERR(dma_chan)) {
-		ret = PTR_ERR(dma_chan);
-		if (ret != -EPROBE_DEFER)
-			dev_err(tspi->dev,
-				"Dma channel is not available: %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(dma_chan))
+		return dev_err_probe(tspi->dev, PTR_ERR(dma_chan),
+				     "Dma channel is not available\n");
 
 	dma_buf = dma_alloc_coherent(tspi->dev, tspi->dma_buf_size,
 				&dma_phys, GFP_KERNEL);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 11/11] spi: tegra20: Simplify with dev_err_probe()
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
                   ` (8 preceding siblings ...)
  2020-09-01 15:27 ` [PATCH 10/11] spi: tegra114: " Krzysztof Kozlowski
@ 2020-09-01 15:27 ` Krzysztof Kozlowski
  2020-09-08  7:27 ` [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Chunyan Zhang
  2020-09-08 17:21 ` Mark Brown
  11 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-tegra20-slink.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index a07b72e9c344..a0810765d4e5 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -600,13 +600,9 @@ static int tegra_slink_init_dma_param(struct tegra_slink_data *tspi,
 	struct dma_slave_config dma_sconfig;
 
 	dma_chan = dma_request_chan(tspi->dev, dma_to_memory ? "rx" : "tx");
-	if (IS_ERR(dma_chan)) {
-		ret = PTR_ERR(dma_chan);
-		if (ret != -EPROBE_DEFER)
-			dev_err(tspi->dev,
-				"Dma channel is not available: %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(dma_chan))
+		return dev_err_probe(tspi->dev, PTR_ERR(dma_chan),
+				     "Dma channel is not available\n");
 
 	dma_buf = dma_alloc_coherent(tspi->dev, tspi->dma_buf_size,
 				&dma_phys, GFP_KERNEL);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 04/11] spi: bcm2835: Simplify with dev_err_probe()
  2020-09-01 15:27 ` [PATCH 04/11] spi: bcm2835: " Krzysztof Kozlowski
@ 2020-09-01 16:08   ` Florian Fainelli
  0 siblings, 0 replies; 18+ messages in thread
From: Florian Fainelli @ 2020-09-01 16:08 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Tudor Ambarus, Mark Brown, Nicolas Ferre,
	Alexandre Belloni, Ludovic Desroches, Nicolas Saenz Julienne,
	Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, Andy Gross, Bjorn Andersson,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Maxime Coquelin,
	Alexandre Torgue, Masahisa Kojima, Jassi Brar, Laxman Dewangan,
	Thierry Reding, Jonathan Hunter, linux-spi, linux-arm-kernel,
	linux-kernel, linux-rpi-kernel, linux-arm-msm, linux-stm32,
	linux-tegra



On 9/1/2020 8:27 AM, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and the error value gets printed.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 03/11] spi: atmel: Simplify with dev_err_probe()
  2020-09-01 15:27 ` [PATCH 03/11] spi: atmel: " Krzysztof Kozlowski
@ 2020-09-01 19:12   ` Alexandre Belloni
  0 siblings, 0 replies; 18+ messages in thread
From: Alexandre Belloni @ 2020-09-01 19:12 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Tudor Ambarus, Mark Brown, Nicolas Ferre, Ludovic Desroches,
	Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, Andy Gross, Bjorn Andersson,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Maxime Coquelin,
	Alexandre Torgue, Masahisa Kojima, Jassi Brar, Laxman Dewangan,
	Thierry Reding, Jonathan Hunter, linux-spi, linux-arm-kernel,
	linux-kernel, linux-rpi-kernel, linux-arm-msm, linux-stm32,
	linux-tegra

On 01/09/2020 17:27:05+0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and the error value gets printed.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
>  drivers/spi/spi-atmel.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index 2cfe6253a784..7c68d5cdbdc6 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -513,9 +513,8 @@ static int atmel_spi_configure_dma(struct spi_master *master,
>  
>  	master->dma_tx = dma_request_chan(dev, "tx");
>  	if (IS_ERR(master->dma_tx)) {
> -		err = PTR_ERR(master->dma_tx);
> -		if (err != -EPROBE_DEFER)
> -			dev_err(dev, "No TX DMA channel, DMA is disabled\n");
> +		err = dev_err_probe(dev, PTR_ERR(master->dma_tx),
> +				    "No TX DMA channel, DMA is disabled\n");
>  		goto error_clear;
>  	}
>  
> -- 
> 2.17.1
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
                   ` (9 preceding siblings ...)
  2020-09-01 15:27 ` [PATCH 11/11] spi: tegra20: " Krzysztof Kozlowski
@ 2020-09-08  7:27 ` Chunyan Zhang
  2020-09-08 17:21 ` Mark Brown
  11 siblings, 0 replies; 18+ messages in thread
From: Chunyan Zhang @ 2020-09-08  7:27 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Maxime Coquelin,
	Alexandre Torgue, Masahisa Kojima, Jassi Brar, Laxman Dewangan,
	Thierry Reding, Jonathan Hunter, linux-spi, Linux ARM,
	Linux Kernel Mailing List, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra, stable

On Tue, 1 Sep 2020 at 23:27, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> If dma_request_chan() for TX channel fails with EPROBE_DEFER, the RX
> channel would not be released and on next re-probe it would be requested
> second time.
>
> Fixes: 386119bc7be9 ("spi: sprd: spi: sprd: Add DMA mode support")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>

Thanks,
Chunyan

> ---
>  drivers/spi/spi-sprd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c
> index 6678f1cbc566..0443fec3a6ab 100644
> --- a/drivers/spi/spi-sprd.c
> +++ b/drivers/spi/spi-sprd.c
> @@ -563,11 +563,11 @@ static int sprd_spi_dma_request(struct sprd_spi *ss)
>
>         ss->dma.dma_chan[SPRD_SPI_TX]  = dma_request_chan(ss->dev, "tx_chn");
>         if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_TX])) {
> +               dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]);
>                 if (PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]) == -EPROBE_DEFER)
>                         return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
>
>                 dev_err(ss->dev, "request TX DMA channel failed!\n");
> -               dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]);
>                 return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
>         }
>
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 02/11] spi: sprd: Simplify with dev_err_probe()
  2020-09-01 15:27 ` [PATCH 02/11] spi: sprd: Simplify with dev_err_probe() Krzysztof Kozlowski
@ 2020-09-08  7:27   ` Chunyan Zhang
  2020-09-08 13:22   ` Mark Brown
  1 sibling, 0 replies; 18+ messages in thread
From: Chunyan Zhang @ 2020-09-08  7:27 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Maxime Coquelin,
	Alexandre Torgue, Masahisa Kojima, Jassi Brar, Laxman Dewangan,
	Thierry Reding, Jonathan Hunter, linux-spi, Linux ARM,
	Linux Kernel Mailing List, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra

On Tue, 1 Sep 2020 at 23:27, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and the error value gets printed.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>

Thanks,
Chunyan

> ---
>  drivers/spi/spi-sprd-adi.c |  5 +----
>  drivers/spi/spi-sprd.c     | 17 +++++------------
>  2 files changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c
> index 127b8bd25831..392ec5cfa3d6 100644
> --- a/drivers/spi/spi-sprd-adi.c
> +++ b/drivers/spi/spi-sprd-adi.c
> @@ -504,10 +504,7 @@ static int sprd_adi_probe(struct platform_device *pdev)
>                         dev_info(&pdev->dev, "no hardware spinlock supplied\n");
>                         break;
>                 default:
> -                       dev_err(&pdev->dev,
> -                               "failed to find hwlock id, %d\n", ret);
> -                       fallthrough;
> -               case -EPROBE_DEFER:
> +                       dev_err_probe(&pdev->dev, ret, "failed to find hwlock id\n");
>                         goto put_ctlr;
>                 }
>         }
> diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c
> index 0443fec3a6ab..635738f54c73 100644
> --- a/drivers/spi/spi-sprd.c
> +++ b/drivers/spi/spi-sprd.c
> @@ -553,22 +553,15 @@ static int sprd_spi_dma_tx_config(struct sprd_spi *ss, struct spi_transfer *t)
>  static int sprd_spi_dma_request(struct sprd_spi *ss)
>  {
>         ss->dma.dma_chan[SPRD_SPI_RX] = dma_request_chan(ss->dev, "rx_chn");
> -       if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_RX])) {
> -               if (PTR_ERR(ss->dma.dma_chan[SPRD_SPI_RX]) == -EPROBE_DEFER)
> -                       return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_RX]);
> -
> -               dev_err(ss->dev, "request RX DMA channel failed!\n");
> -               return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_RX]);
> -       }
> +       if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_RX]))
> +               return dev_err_probe(ss->dev, PTR_ERR(ss->dma.dma_chan[SPRD_SPI_RX]),
> +                                    "request RX DMA channel failed!\n");
>
>         ss->dma.dma_chan[SPRD_SPI_TX]  = dma_request_chan(ss->dev, "tx_chn");
>         if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_TX])) {
>                 dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]);
> -               if (PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]) == -EPROBE_DEFER)
> -                       return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
> -
> -               dev_err(ss->dev, "request TX DMA channel failed!\n");
> -               return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
> +               return dev_err_probe(ss->dev, PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]),
> +                                    "request TX DMA channel failed!\n");
>         }
>
>         return 0;
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 02/11] spi: sprd: Simplify with dev_err_probe()
  2020-09-01 15:27 ` [PATCH 02/11] spi: sprd: Simplify with dev_err_probe() Krzysztof Kozlowski
  2020-09-08  7:27   ` Chunyan Zhang
@ 2020-09-08 13:22   ` Mark Brown
  1 sibling, 0 replies; 18+ messages in thread
From: Mark Brown @ 2020-09-08 13:22 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Tudor Ambarus, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]

On Tue, Sep 01, 2020 at 05:27:04PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and the error value gets printed.

This doesn't apply against current code, please check and resend.

Applying: spi: sprd: Simplify with dev_err_probe()
Using index info to reconstruct a base tree...
M	drivers/spi/spi-sprd-adi.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/spi/spi-sprd-adi.c
CONFLICT (content): Merge conflict in drivers/spi/spi-sprd-adi.c

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 08/11] spi: stm32: Simplify with dev_err_probe()
  2020-09-01 15:27 ` [PATCH 08/11] spi: stm32: " Krzysztof Kozlowski
@ 2020-09-08 13:53   ` Alain Volmat
  0 siblings, 0 replies; 18+ messages in thread
From: Alain Volmat @ 2020-09-08 13:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre TORGUE, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra

On Tue, Sep 01, 2020 at 03:27:10PM +0000, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and the error value gets printed.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Reviewed-by: Alain Volmat <alain.volmat@st.com>

> ---
>  drivers/spi/spi-stm32.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index d4b33b358a31..f0e594b2fee4 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -1857,9 +1857,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
>  
>  	spi->irq = platform_get_irq(pdev, 0);
>  	if (spi->irq <= 0) {
> -		ret = spi->irq;
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(&pdev->dev, "failed to get irq: %d\n", ret);
> +		ret = dev_err_probe(&pdev->dev, spi->irq, "failed to get irq\n");
>  		goto err_master_put;
>  	}
>  	ret = devm_request_threaded_irq(&pdev->dev, spi->irq,
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral
  2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
                   ` (10 preceding siblings ...)
  2020-09-08  7:27 ` [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Chunyan Zhang
@ 2020-09-08 17:21 ` Mark Brown
  11 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2020-09-08 17:21 UTC (permalink / raw)
  To: linux-arm-kernel, Masahisa Kojima, Maxime Coquelin,
	linux-rpi-kernel, Baolin Wang, Alexandre Torgue, linux-stm32,
	linux-kernel, Jonathan Hunter, Thierry Reding, Tudor Ambarus,
	linux-tegra, Andy Gross, Scott Branden, Nicolas Ferre,
	Laxman Dewangan, linux-spi, Orson Zhai, Ludovic Desroches,
	Bjorn Andersson, Krzysztof Kozlowski, Florian Fainelli,
	Jassi Brar, linux-arm-msm, bcm-kernel-feedback-list, Ray Jui,
	Nicolas Saenz Julienne, Chunyan Zhang, Alexandre Belloni
  Cc: stable

On Tue, 1 Sep 2020 17:27:03 +0200, Krzysztof Kozlowski wrote:
> If dma_request_chan() for TX channel fails with EPROBE_DEFER, the RX
> channel would not be released and on next re-probe it would be requested
> second time.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[01/11] spi: sprd: Release DMA channel also on probe deferral
        commit: 687a2e76186dcfa42f22c14b655c3fb159839e79
[02/11] spi: sprd: Simplify with dev_err_probe()
        (no commit info)
[03/11] spi: atmel: Simplify with dev_err_probe()
        commit: 96189475820835d7176171492640a58c600aca42
[04/11] spi: bcm2835: Simplify with dev_err_probe()
        commit: 65acd82c4eb7f08747922ed3afb2d099a1b25d3f
[05/11] spi: cadence-quadspi: Simplify with dev_err_probe()
        commit: 436a5c208037a71f64f35312969e27a05d6d7c53
[06/11] spi: spi-mux: Simplify with dev_err_probe()
        commit: 2d9bdf645584d15ed1d4aae6204cb6ea8b673d48
[07/11] spi: qcom-qspi: Simplify with dev_err_probe()
        commit: 034532681c56cfffaea169a59155fe11e9172d9c
[08/11] spi: stm32: Simplify with dev_err_probe()
        commit: a05cec2dc2df1e5d25addb7aba398f3eb451e163
[09/11] spi: synquacer: Simplify with dev_err_probe()
        commit: 74ee6dc1257edf5fcfba67fd8075b766d11c42a0
[10/11] spi: tegra114: Simplify with dev_err_probe()
        commit: 68fffc191ed19ea5618285b128e6048d1536e680
[11/11] spi: tegra20: Simplify with dev_err_probe()
        commit: 7708aff1e2ebc8fdccdd61cf9ab8576a66989166

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-09-08 17:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 02/11] spi: sprd: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-08  7:27   ` Chunyan Zhang
2020-09-08 13:22   ` Mark Brown
2020-09-01 15:27 ` [PATCH 03/11] spi: atmel: " Krzysztof Kozlowski
2020-09-01 19:12   ` Alexandre Belloni
2020-09-01 15:27 ` [PATCH 04/11] spi: bcm2835: " Krzysztof Kozlowski
2020-09-01 16:08   ` Florian Fainelli
2020-09-01 15:27 ` [PATCH 05/11] spi: cadence-quadspi: " Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 06/11] spi: spi-mux: " Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 07/11] spi: qcom-qspi: " Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 08/11] spi: stm32: " Krzysztof Kozlowski
2020-09-08 13:53   ` Alain Volmat
2020-09-01 15:27 ` [PATCH 09/11] spi: synquacer: " Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 10/11] spi: tegra114: " Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 11/11] spi: tegra20: " Krzysztof Kozlowski
2020-09-08  7:27 ` [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Chunyan Zhang
2020-09-08 17:21 ` Mark Brown

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox