[PATCH] drm/arm/malidp: Stop using iommu_present()
Brian Starkey
brian.starkey at arm.com
Wed Apr 6 09:27:00 UTC 2022
Hi Robin,
On Tue, Apr 05, 2022 at 03:11:18PM +0100, Robin Murphy wrote:
> iommu_get_domain_for_dev() is already perfectly happy to return NULL
> if the given device has no IOMMU. Drop the unnecessary check.
>
> Signed-off-by: Robin Murphy <robin.murphy at arm.com>
LGTM, Acked-by: Brian Starkey <brian.starkey at arm.com>
I'll have to leave it to Liviu to push though.
Thanks,
-Brian
> ---
> drivers/gpu/drm/arm/malidp_planes.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
> index 0562bdaac00c..81d9f5004025 100644
> --- a/drivers/gpu/drm/arm/malidp_planes.c
> +++ b/drivers/gpu/drm/arm/malidp_planes.c
> @@ -310,17 +310,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp,
>
> static u32 malidp_get_pgsize_bitmap(struct malidp_plane *mp)
> {
> - u32 pgsize_bitmap = 0;
> + struct iommu_domain *mmu_dom;
>
> - if (iommu_present(&platform_bus_type)) {
> - struct iommu_domain *mmu_dom =
> - iommu_get_domain_for_dev(mp->base.dev->dev);
> + mmu_dom = iommu_get_domain_for_dev(mp->base.dev->dev);
> + if (mmu_dom)
> + return mmu_dom->pgsize_bitmap;
>
> - if (mmu_dom)
> - pgsize_bitmap = mmu_dom->pgsize_bitmap;
> - }
> -
> - return pgsize_bitmap;
> + return 0;
> }
>
> /*
> --
> 2.28.0.dirty
>
More information about the dri-devel
mailing list