[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ca8c5a447b87002334f83325f28823008b4ce420.1666042873.git.nicolinc@nvidia.com>
Date: Mon, 17 Oct 2022 16:02:36 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: <joro@...tes.org>, <will@...nel.org>, <robin.murphy@....com>
CC: <jgg@...dia.com>, <kevin.tian@...el.com>, <yong.wu@...iatek.com>,
<matthias.bgg@...il.com>, <jean-philippe@...aro.org>,
<iommu@...ts.linux.dev>, <linux-mediatek@...ts.infradead.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>,
<virtualization@...ts.linux-foundation.org>
Subject: [PATCH v7 5/5] iommu: Propagate return value in ->attach_dev callback functions
The mtk_iommu and virtio drivers have places in the ->attach_dev callback
functions that return hardcode errnos instead of the returned values, but
callers of these ->attach_dv callback functions may care. Propagate them
directly without the extra conversions.
Reviewed-by: Kevin Tian <kevin.tian@...el.com>
Reviewed-by: Jean-Philippe Brucker <jean-philippe@...aro.org>
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Reviewed-by: Yong Wu <yong.wu@...iatek.com>
Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
---
drivers/iommu/mtk_iommu.c | 2 +-
drivers/iommu/virtio-iommu.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index f3dc2aba188e..660c5296f338 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -668,7 +668,7 @@ static int mtk_iommu_attach_device(struct iommu_domain *domain,
ret = mtk_iommu_domain_finalise(dom, frstdata, region_id);
if (ret) {
mutex_unlock(&dom->mutex);
- return -ENODEV;
+ return ret;
}
dom->bank = &data->bank[bankid];
}
diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c
index 9e0ca757fa42..a204942f28fe 100644
--- a/drivers/iommu/virtio-iommu.c
+++ b/drivers/iommu/virtio-iommu.c
@@ -695,7 +695,7 @@ static int viommu_domain_finalise(struct viommu_endpoint *vdev,
if (ret) {
ida_free(&viommu->domain_ids, vdomain->id);
vdomain->viommu = NULL;
- return -EOPNOTSUPP;
+ return ret;
}
}
--
2.17.1
Powered by blists - more mailing lists