linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] spi: bcm2835: Fix error return code in bcm2835_dma_init()
@ 2020-05-06 12:56 Wei Yongjun
  2020-05-06 14:55 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-05-06 12:56 UTC (permalink / raw)
  To: Mark Brown, Nicolas Saenz Julienne, Florian Fainelli, Ray Jui,
	Scott Branden
  Cc: Wei Yongjun, bcm-kernel-feedback-list, linux-spi,
	linux-rpi-kernel, linux-arm-kernel, kernel-janitors

Fix to return negative error code -ENOMEM from the dma mapping error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/spi/spi-bcm2835.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 11c235879bb7..c4f4bd135279 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -940,6 +940,7 @@ static int bcm2835_dma_init(struct spi_controller *ctlr, struct device *dev,
 	if (dma_mapping_error(ctlr->dma_tx->device->dev, bs->fill_tx_addr)) {
 		dev_err(dev, "cannot map zero page - not using DMA mode\n");
 		bs->fill_tx_addr = 0;
+		ret = -ENOMEM;
 		goto err_release;
 	}
 
@@ -949,6 +950,7 @@ static int bcm2835_dma_init(struct spi_controller *ctlr, struct device *dev,
 						     DMA_MEM_TO_DEV, 0);
 	if (!bs->fill_tx_desc) {
 		dev_err(dev, "cannot prepare fill_tx_desc - not using DMA mode\n");
+		ret = -ENOMEM;
 		goto err_release;
 	}
 
@@ -979,6 +981,7 @@ static int bcm2835_dma_init(struct spi_controller *ctlr, struct device *dev,
 	if (dma_mapping_error(ctlr->dma_rx->device->dev, bs->clear_rx_addr)) {
 		dev_err(dev, "cannot map clear_rx_cs - not using DMA mode\n");
 		bs->clear_rx_addr = 0;
+		ret = -ENOMEM;
 		goto err_release;
 	}
 
@@ -989,6 +992,7 @@ static int bcm2835_dma_init(struct spi_controller *ctlr, struct device *dev,
 					   DMA_MEM_TO_DEV, 0);
 		if (!bs->clear_rx_desc[i]) {
 			dev_err(dev, "cannot prepare clear_rx_desc - not using DMA mode\n");
+			ret = -ENOMEM;
 			goto err_release;
 		}




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

* Re: [PATCH -next] spi: bcm2835: Fix error return code in bcm2835_dma_init()
  2020-05-06 12:56 [PATCH -next] spi: bcm2835: Fix error return code in bcm2835_dma_init() Wei Yongjun
@ 2020-05-06 14:55 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-05-06 14:55 UTC (permalink / raw)
  To: Ray Jui, Scott Branden, Nicolas Saenz Julienne, Wei Yongjun,
	Florian Fainelli
  Cc: bcm-kernel-feedback-list, kernel-janitors, linux-rpi-kernel,
	linux-spi, linux-arm-kernel

On Wed, 6 May 2020 12:56:07 +0000, Wei Yongjun wrote:
> Fix to return negative error code -ENOMEM from the dma mapping error
> handling case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/spi/spi-bcm2835.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: bcm2835: Fix error return code in bcm2835_dma_init()
      commit: dd4441ab1fa1e2787a5f218f92d8ead1aa5ce6b5

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

end of thread, other threads:[~2020-05-06 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06 12:56 [PATCH -next] spi: bcm2835: Fix error return code in bcm2835_dma_init() Wei Yongjun
2020-05-06 14:55 ` 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).