linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] spi: Use dev_err_probe instead of dev_err
@ 2023-07-26 10:54 Wang Ming
  2023-07-26 15:02 ` Florian Fainelli
  2023-07-31 14:25 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Ming @ 2023-07-26 10:54 UTC (permalink / raw)
  To: Mark Brown, Florian Fainelli, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, linux-spi,
	linux-rpi-kernel, linux-arm-kernel, linux-kernel
  Cc: opensource.kernel, Wang Ming

It is possible that dma_request_chan will return EPROBE_DEFER,
which means that dev is not ready yet. In this case,
dev_err(dev), there will be no output. This patch fixes the bug.

Signed-off-by: Wang Ming <machel@vivo.com>
---
 drivers/spi/spi-bcm2835.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 3b253da98c05..cbf025054c96 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -903,15 +903,15 @@ static int bcm2835_dma_init(struct spi_controller *ctlr, struct device *dev,
 	/* get tx/rx dma */
 	ctlr->dma_tx = dma_request_chan(dev, "tx");
 	if (IS_ERR(ctlr->dma_tx)) {
-		dev_err(dev, "no tx-dma configuration found - not using dma mode\n");
-		ret = PTR_ERR(ctlr->dma_tx);
+		ret = dev_err_probe(dev, PTR_ERR(ctlr->dma_tx),
+			"no tx-dma configuration found - not using dma mode\n");
 		ctlr->dma_tx = NULL;
 		goto err;
 	}
 	ctlr->dma_rx = dma_request_chan(dev, "rx");
 	if (IS_ERR(ctlr->dma_rx)) {
-		dev_err(dev, "no rx-dma configuration found - not using dma mode\n");
-		ret = PTR_ERR(ctlr->dma_rx);
+		ret = dev_err_probe(dev, PTR_ERR(ctlr->dma_rx),
+			"no rx-dma configuration found - not using dma mode\n");
 		ctlr->dma_rx = NULL;
 		goto err_release;
 	}
-- 
2.25.1


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

* Re: [PATCH v2] spi: Use dev_err_probe instead of dev_err
  2023-07-26 10:54 [PATCH v2] spi: Use dev_err_probe instead of dev_err Wang Ming
@ 2023-07-26 15:02 ` Florian Fainelli
  2023-07-31 14:25 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2023-07-26 15:02 UTC (permalink / raw)
  To: Wang Ming, Mark Brown, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, linux-spi,
	linux-rpi-kernel, linux-arm-kernel, linux-kernel
  Cc: opensource.kernel

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



On 7/26/2023 3:54 AM, Wang Ming wrote:
> It is possible that dma_request_chan will return EPROBE_DEFER,
> which means that dev is not ready yet. In this case,
> dev_err(dev), there will be no output. This patch fixes the bug.
> 
> Signed-off-by: Wang Ming <machel@vivo.com>

This looks reasonable, though could you use the same prefix that was 
used for previous changes:

spi: bcm2835: Use dev_err_probe instead of dev_err

with that done, please add a:

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

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

* Re: [PATCH v2] spi: Use dev_err_probe instead of dev_err
  2023-07-26 10:54 [PATCH v2] spi: Use dev_err_probe instead of dev_err Wang Ming
  2023-07-26 15:02 ` Florian Fainelli
@ 2023-07-31 14:25 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-07-31 14:25 UTC (permalink / raw)
  To: Florian Fainelli, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, linux-spi,
	linux-rpi-kernel, linux-arm-kernel, linux-kernel, Wang Ming
  Cc: opensource.kernel

On Wed, 26 Jul 2023 18:54:47 +0800, Wang Ming wrote:
> It is possible that dma_request_chan will return EPROBE_DEFER,
> which means that dev is not ready yet. In this case,
> dev_err(dev), there will be no output. This patch fixes the bug.
> 
> 

Applied to

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

Thanks!

[1/1] spi: Use dev_err_probe instead of dev_err
      commit: 893aa09ee5959533d8e51e06b1bde35286edaf70

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] 3+ messages in thread

end of thread, other threads:[~2023-07-31 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-26 10:54 [PATCH v2] spi: Use dev_err_probe instead of dev_err Wang Ming
2023-07-26 15:02 ` Florian Fainelli
2023-07-31 14:25 ` Mark Brown

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).