Message ID | 8040df414a1d4bc007a25553b8341acf37ead670.1663836372.git.nicolinc@nvidia.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Define EINVAL as device/domain incompatibility | expand |
On Thu, Sep 22, 2022 at 01:54:45AM -0700, Nicolin Chen wrote: > 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@intel.com> > Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org> > Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> > --- > drivers/iommu/mtk_iommu.c | 2 +- > drivers/iommu/virtio-iommu.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Jason
On Thu, 2022-09-22 at 01:54 -0700, Nicolin Chen wrote: > 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@intel.com> > Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org> > Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> > --- > drivers/iommu/mtk_iommu.c | 2 +- > drivers/iommu/virtio-iommu.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > Reviewed-by: Yong Wu <yong.wu@mediatek.com> #For mtk_iommu.c Thanks.
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index be1a7d1cc630..c30dc8f81778 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -666,7 +666,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 87128266b6e3..35de7b433b17 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -696,7 +696,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; } }