From: Dan Carpenter <error27@gmail.com>
To: Yong Wu <yong.wu@mediatek.com>
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
"Chengci.Xu" <chengci.xu@mediatek.com>,
iommu@lists.linux.dev, linux-mediatek@lists.infradead.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] iommu/mediatek: fix a reversed test in probe
Date: Sat, 25 Mar 2023 14:07:52 +0300 [thread overview]
Message-ID: <88c83ce7-5d1a-44a8-b9bf-0d01cfea24db@kili.mountain> (raw)
The dma_set_mask() function returns negative error codes on failure but
this code is testing for zero instead.
Fixes: f4b49c7c5e67 ("iommu/mediatek: Set dma_mask for PGTABLE_PA_35_EN")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
drivers/iommu/mtk_iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index 1a75b4382a92..6a00ce208dc2 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -1260,7 +1260,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
if (MTK_IOMMU_HAS_FLAG(data->plat_data, PGTABLE_PA_35_EN)) {
ret = dma_set_mask(dev, DMA_BIT_MASK(35));
- if (!ret) {
+ if (ret) {
dev_err(dev, "Failed to set dma_mask 35.\n");
return ret;
}
--
2.39.1
next reply other threads:[~2023-03-25 11:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-25 11:07 Dan Carpenter [this message]
2023-03-27 0:55 ` [PATCH] iommu/mediatek: fix a reversed test in probe Yong Wu (吴勇)
2023-03-27 7:49 ` AngeloGioacchino Del Regno
2023-03-28 13:28 ` Joerg Roedel
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=88c83ce7-5d1a-44a8-b9bf-0d01cfea24db@kili.mountain \
--to=error27@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chengci.xu@mediatek.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=yong.wu@mediatek.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.