Commit cb06b259 authored by Pasha Tatashin's avatar Pasha Tatashin Committed by Joerg Roedel
Browse files

iommu/sun50i: use page allocation function provided by iommu-pages.h



Convert iommu/sun50i-iommu.c to use the new page allocation functions
provided in iommu-pages.h.

Signed-off-by: default avatarPasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Acked-by: default avatarJernej Skrabec <jernej.skrabec@gmail.com>
Tested-by: default avatarBagas Sanjaya <bagasdotme@gmail.com>
Link: https://lore.kernel.org/r/20240413002522.1101315-9-pasha.tatashin@soleen.com


Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 5404ccaa
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@
#include <linux/spinlock.h>
#include <linux/types.h>

#include "iommu-pages.h"

#define IOMMU_RESET_REG			0x010
#define IOMMU_RESET_RELEASE_ALL			0xffffffff
#define IOMMU_ENABLE_REG		0x020
@@ -679,8 +681,7 @@ sun50i_iommu_domain_alloc_paging(struct device *dev)
	if (!sun50i_domain)
		return NULL;

	sun50i_domain->dt = (u32 *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
						    get_order(DT_SIZE));
	sun50i_domain->dt = iommu_alloc_pages(GFP_KERNEL, get_order(DT_SIZE));
	if (!sun50i_domain->dt)
		goto err_free_domain;

@@ -702,7 +703,7 @@ static void sun50i_iommu_domain_free(struct iommu_domain *domain)
{
	struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain);

	free_pages((unsigned long)sun50i_domain->dt, get_order(DT_SIZE));
	iommu_free_pages(sun50i_domain->dt, get_order(DT_SIZE));
	sun50i_domain->dt = NULL;

	kfree(sun50i_domain);