All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()
@ 2023-07-19  7:13 杜敏杰
  2023-07-19 12:42 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: 杜敏杰 @ 2023-07-19  7:13 UTC (permalink / raw)
  To: Vladimir Oltean, Mark Brown, Richard Cochran,
	open list:FREESCALE DSPI DRIVER, open list,
	open list:PTP HARDWARE CLOCK SUPPORT
  Cc: opensource.kernel, 杜敏杰

It is possible for dma_request_chan() to return EPROBE_DEFER, which means
dev is not ready yet.
At this point dev_err() will have no output.

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 drivers/spi/spi-fsl-dspi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index ca41c8a8b..6aaa529b7 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -503,15 +503,14 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
 
 	dma->chan_rx = dma_request_chan(dev, "rx");
 	if (IS_ERR(dma->chan_rx)) {
-		dev_err(dev, "rx dma channel not available\n");
-		ret = PTR_ERR(dma->chan_rx);
-		return ret;
+		return dev_err_probe(dev, PTR_ERR(dma->chan_rx),
+							"rx dma channel not available\n");
 	}
 
 	dma->chan_tx = dma_request_chan(dev, "tx");
 	if (IS_ERR(dma->chan_tx)) {
-		dev_err(dev, "tx dma channel not available\n");
 		ret = PTR_ERR(dma->chan_tx);
+		dev_err_probe(dev, ret, "tx dma channel not available\n");
 		goto err_tx_channel;
 	}
 
-- 
2.39.0


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

* Re: [PATCH v1] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()
  2023-07-19  7:13 [PATCH v1] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma() 杜敏杰
@ 2023-07-19 12:42 ` Mark Brown
  2023-07-21  2:54   ` 回复: " 杜敏杰
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2023-07-19 12:42 UTC (permalink / raw)
  To: 杜敏杰
  Cc: Vladimir Oltean, Richard Cochran,
	open list:FREESCALE DSPI DRIVER, open list,
	open list:PTP HARDWARE CLOCK SUPPORT, opensource.kernel

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

On Wed, Jul 19, 2023 at 07:13:02AM +0000, 杜敏杰 wrote:

> -		dev_err(dev, "rx dma channel not available\n");
> -		ret = PTR_ERR(dma->chan_rx);
> -		return ret;
> +		return dev_err_probe(dev, PTR_ERR(dma->chan_rx),
> +							"rx dma channel not available\n");

The indentation on the second line is messed up here, it's far too
indented.

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

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

* 回复: [PATCH v1] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()
  2023-07-19 12:42 ` Mark Brown
@ 2023-07-21  2:54   ` 杜敏杰
  2023-07-21 10:55     ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: 杜敏杰 @ 2023-07-21  2:54 UTC (permalink / raw)
  To: Mark Brown
  Cc: Vladimir Oltean, Richard Cochran,
	open list:FREESCALE DSPI DRIVER, open list,
	open list:PTP HARDWARE CLOCK SUPPORT, opensource.kernel

Hi Mark!

Thank you for your reply!
You said:

> The indentation on the second line is messed up here, it's far too indented.

Could you tell me what is the specification for indentation?

regards,
Minjie

--------------------
发件人: Mark Brown <broonie@kernel.org> 
发送时间: 2023年7月19日 20:43
收件人: 杜敏杰 <duminjie@vivo.com>
抄送: Vladimir Oltean <olteanv@gmail.com>; Richard Cochran <richardcochran@gmail.com>; open list:FREESCALE DSPI DRIVER <linux-spi@vger.kernel.org>; open list <linux-kernel@vger.kernel.org>; open list:PTP HARDWARE CLOCK SUPPORT <netdev@vger.kernel.org>; opensource.kernel <opensource.kernel@vivo.com>
主题: Re: [PATCH v1] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()

On Wed, Jul 19, 2023 at 07:13:02AM +0000, 杜敏杰 wrote:

> -		dev_err(dev, "rx dma channel not available\n");
> -		ret = PTR_ERR(dma->chan_rx);
> -		return ret;
> +		return dev_err_probe(dev, PTR_ERR(dma->chan_rx),
> +							"rx dma channel not available\n");

The indentation on the second line is messed up here, it's far too indented.

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

* Re: 回复: [PATCH v1] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()
  2023-07-21  2:54   ` 回复: " 杜敏杰
@ 2023-07-21 10:55     ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2023-07-21 10:55 UTC (permalink / raw)
  To: 杜敏杰
  Cc: Vladimir Oltean, Richard Cochran,
	open list:FREESCALE DSPI DRIVER, open list,
	open list:PTP HARDWARE CLOCK SUPPORT, opensource.kernel

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

On Fri, Jul 21, 2023 at 02:54:26AM +0000, 杜敏杰 wrote:
> You said:

> > The indentation on the second line is messed up here, it's far too indented.

> Could you tell me what is the specification for indentation?

Documentation/process/coding-style.rst and more generally things should
look like the nearby code.

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

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

end of thread, other threads:[~2023-07-21 10:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-19  7:13 [PATCH v1] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma() 杜敏杰
2023-07-19 12:42 ` Mark Brown
2023-07-21  2:54   ` 回复: " 杜敏杰
2023-07-21 10:55     ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.