From: Ma Ke <make24@iscas.ac.cn>
To: Eugeniy.Paltsev@synopsys.com, vkoul@kernel.org,
andriy.shevchenko@linux.intel.com, jee.heng.sia@intel.com
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
Ma Ke <make24@iscas.ac.cn>
Subject: [PATCH] dmaengine: dw-axi-dmac: Add check for dma_set_max_seg_size in dw_probe()
Date: Wed, 26 Jun 2024 16:54:16 +0800 [thread overview]
Message-ID: <20240626085416.2831017-1-make24@iscas.ac.cn> (raw)
As the possible failure of the dma_set_max_seg_size(), we should better
check the return value of the dma_set_max_seg_size().
Fixes: 78a90a1e489e ("dmaengine: dw-axi-dmac: Set constraint to the Max segment size")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index fffafa86d964..689667e10928 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1579,7 +1579,10 @@ static int dw_probe(struct platform_device *pdev)
* Therefore, set constraint to 1024 * 4.
*/
dw->dma.dev->dma_parms = &dw->dma_parms;
- dma_set_max_seg_size(&pdev->dev, MAX_BLOCK_SIZE);
+ ret = dma_set_max_seg_size(&pdev->dev, MAX_BLOCK_SIZE);
+ if (ret)
+ return ret;
+
platform_set_drvdata(pdev, chip);
pm_runtime_enable(chip->dev);
--
2.25.1
next reply other threads:[~2024-06-26 8:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 8:54 Ma Ke [this message]
2024-06-26 15:45 ` Markus Elfring
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=20240626085416.2831017-1-make24@iscas.ac.cn \
--to=make24@iscas.ac.cn \
--cc=Eugeniy.Paltsev@synopsys.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=jee.heng.sia@intel.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®