Skip to content

Commit

Permalink
iommu: Propagate return value in ->attach_dev callback functions
Browse files Browse the repository at this point in the history
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.

Link: https://lore.kernel.org/r/ca8c5a447b87002334f83325f28823008b4ce420.1666042873.git.nicolinc@nvidia.com
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
  • Loading branch information
Nicolin Chen authored and Jason Gunthorpe committed Nov 1, 2022
1 parent f4a1477 commit 04cee82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/iommu/mtk_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/iommu/virtio-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,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;
}
}

Expand Down

0 comments on commit 04cee82

Please sign in to comment.