dmaengine Archive mirror
 help / color / mirror / Atom feed
From: Chen Ni <nichen@iscas.ac.cn>
To: vkoul@kernel.org, florian.fainelli@broadcom.com,
	rjui@broadcom.com, sbranden@broadcom.com
Cc: bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Chen Ni <nichen@iscas.ac.cn>
Subject: [PATCH] dmaengine: bcm2835-dma: Add check for dma_set_max_seg_size
Date: Mon, 29 Apr 2024 12:13:12 +0800	[thread overview]
Message-ID: <20240429041312.2150441-1-nichen@iscas.ac.cn> (raw)

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


             reply	other threads:[~2024-04-29  4:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29  4:13 Chen Ni [this message]
2024-04-29  4:37 ` [PATCH] dmaengine: bcm2835-dma: Add check for dma_set_max_seg_size Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240429041312.2150441-1-nichen@iscas.ac.cn \
    --to=nichen@iscas.ac.cn \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).