summaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2023-11-29 10:00:00 +0100
committerVinod Koul <vkoul@kernel.org>2023-12-11 13:06:54 +0100
commitbffa7218dcddb80e7f18dfa545dd4b359b11dd93 (patch)
treed248b6e105630558fb161daecb4e7fff9e20f8af /drivers/dma
parentdmaengine: idxd: Fix incorrect descriptions for GRPCFG register (diff)
downloadlinux-bffa7218dcddb80e7f18dfa545dd4b359b11dd93.tar.xz
linux-bffa7218dcddb80e7f18dfa545dd4b359b11dd93.zip
dmaengine: fsl-edma: fix wrong pointer check in fsl_edma3_attach_pd()
device_link_add() returns NULL pointer not PTR_ERR() when it fails, so replace the IS_ERR() check with NULL pointer check. Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20231129090000.841440-1-yangyingliang@huaweicloud.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/fsl-edma-main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c
index aea7a703dda7..238a69bd0d6f 100644
--- a/drivers/dma/fsl-edma-main.c
+++ b/drivers/dma/fsl-edma-main.c
@@ -396,9 +396,8 @@ static int fsl_edma3_attach_pd(struct platform_device *pdev, struct fsl_edma_eng
link = device_link_add(dev, pd_chan, DL_FLAG_STATELESS |
DL_FLAG_PM_RUNTIME |
DL_FLAG_RPM_ACTIVE);
- if (IS_ERR(link)) {
- dev_err(dev, "Failed to add device_link to %d: %ld\n", i,
- PTR_ERR(link));
+ if (!link) {
+ dev_err(dev, "Failed to add device_link to %d\n", i);
return -EINVAL;
}