* [PATCH v2] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()
@ 2023-07-25 3:50 Minjie Du
2023-07-25 16:49 ` Mark Brown
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Minjie Du @ 2023-07-25 3:50 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, Minjie Du
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 v2] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()
2023-07-25 3:50 [PATCH v2] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma() Minjie Du
@ 2023-07-25 16:49 ` Mark Brown
2023-07-25 17:05 ` Vladimir Oltean
2023-07-27 21:07 ` andy.shevchenko
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2023-07-25 16:49 UTC (permalink / raw)
To: Vladimir Oltean, Richard Cochran, linux-spi, linux-kernel, netdev,
Minjie Du
Cc: opensource.kernel
On Tue, 25 Jul 2023 11:50:37 +0800, Minjie Du wrote:
> 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.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()
commit: 908e5a3d4e6f60fa2d3912be7087e745639c4404
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] 4+ messages in thread* Re: [PATCH v2] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()
2023-07-25 3:50 [PATCH v2] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma() Minjie Du
2023-07-25 16:49 ` Mark Brown
@ 2023-07-25 17:05 ` Vladimir Oltean
2023-07-27 21:07 ` andy.shevchenko
2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Oltean @ 2023-07-25 17:05 UTC (permalink / raw)
To: Minjie Du
Cc: Mark Brown, Richard Cochran, open list:FREESCALE DSPI DRIVER,
open list, open list:PTP HARDWARE CLOCK SUPPORT,
opensource.kernel
On Tue, Jul 25, 2023 at 11:50:37AM +0800, Minjie Du wrote:
> 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");
This does not have correct alignment either. Tabs are supposed to be
rendered using 8 spaces.
> }
>
> 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 [flat|nested] 4+ messages in thread* Re: [PATCH v2] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()
2023-07-25 3:50 [PATCH v2] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma() Minjie Du
2023-07-25 16:49 ` Mark Brown
2023-07-25 17:05 ` Vladimir Oltean
@ 2023-07-27 21:07 ` andy.shevchenko
2 siblings, 0 replies; 4+ messages in thread
From: andy.shevchenko @ 2023-07-27 21:07 UTC (permalink / raw)
To: Minjie Du
Cc: Vladimir Oltean, Mark Brown, Richard Cochran,
open list:FREESCALE DSPI DRIVER, open list,
open list:PTP HARDWARE CLOCK SUPPORT, opensource.kernel
Tue, Jul 25, 2023 at 11:50:37AM +0800, Minjie Du kirjoitti:
> 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.
...
> 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");
It can be even simpler
ret = dev_err_probe(dev, PTR_ERR(dma->chan_tx), "tx dma channel not available\n");
> goto err_tx_channel;
> }
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-07-27 21:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-25 3:50 [PATCH v2] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma() Minjie Du
2023-07-25 16:49 ` Mark Brown
2023-07-25 17:05 ` Vladimir Oltean
2023-07-27 21:07 ` andy.shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).