dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: bcm2835-dma: Add check for dma_set_max_seg_size
@ 2024-04-29  4:13 Chen Ni
  2024-04-29  4:37 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Ni @ 2024-04-29  4:13 UTC (permalink / raw)
  To: vkoul, florian.fainelli, rjui, sbranden
  Cc: bcm-kernel-feedback-list, dmaengine, linux-rpi-kernel,
	linux-arm-kernel, linux-kernel, Chen Ni

Add check for the return value of dma_set_max_seg_size() and return
the error if it fails in order to catch the error.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/dma/bcm2835-dma.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
index 9d74fe97452e..d1e775a2f6b3 100644
--- a/drivers/dma/bcm2835-dma.c
+++ b/drivers/dma/bcm2835-dma.c
@@ -899,7 +899,11 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
 	if (!od)
 		return -ENOMEM;
 
-	dma_set_max_seg_size(&pdev->dev, 0x3FFFFFFF);
+	rc = dma_set_max_seg_size(&pdev->dev, 0x3FFFFFFF);
+	if (rc) {
+		dev_err(&pdev->dev, "Unable to set dma device segment size\n");
+		return rc;
+	}
 
 	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
-- 
2.25.1


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

* Re: [PATCH] dmaengine: bcm2835-dma: Add check for dma_set_max_seg_size
  2024-04-29  4:13 [PATCH] dmaengine: bcm2835-dma: Add check for dma_set_max_seg_size Chen Ni
@ 2024-04-29  4:37 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2024-04-29  4:37 UTC (permalink / raw)
  To: Chen Ni
  Cc: vkoul, florian.fainelli, rjui, sbranden,
	bcm-kernel-feedback-list, dmaengine, linux-rpi-kernel,
	linux-arm-kernel, linux-kernel

On Mon, Apr 29, 2024 at 12:13:12PM +0800, Chen Ni wrote:
> Add check for the return value of dma_set_max_seg_size() and return
> the error if it fails in order to catch the error.

Ok. this looks like you're looking t all dma_set_max_seg_size callers?
If so mybe just work on removing the return value instead..


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

end of thread, other threads:[~2024-04-29  4:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-29  4:13 [PATCH] dmaengine: bcm2835-dma: Add check for dma_set_max_seg_size Chen Ni
2024-04-29  4:37 ` Christoph Hellwig

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