Skip to content

Commit 04cee82

Browse files
nicolincjgunthorpe
authored andcommitted
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. Link: https://lore.kernel.org/r/ca8c5a447b87002334f83325f28823008b4ce420.1666042873.git.nicolinc@nvidia.com Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Jean-Philippe Brucker <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Yong Wu <[email protected]> Signed-off-by: Nicolin Chen <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent f4a1477 commit 04cee82

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ static int mtk_iommu_attach_device(struct iommu_domain *domain,
668668
ret = mtk_iommu_domain_finalise(dom, frstdata, region_id);
669669
if (ret) {
670670
mutex_unlock(&dom->mutex);
671-
return -ENODEV;
671+
return ret;
672672
}
673673
dom->bank = &data->bank[bankid];
674674
}

drivers/iommu/virtio-iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ static int viommu_domain_finalise(struct viommu_endpoint *vdev,
697697
if (ret) {
698698
ida_free(&viommu->domain_ids, vdomain->id);
699699
vdomain->viommu = NULL;
700-
return -EOPNOTSUPP;
700+
return ret;
701701
}
702702
}
703703

0 commit comments

Comments
 (0)