Skip to content

Commit cb06b25

Browse files
soleenjoergroedel
authored andcommitted
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: Pasha Tatashin <pasha.tatashin@soleen.com> Acked-by: David Rientjes <rientjes@google.com> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Tested-by: Bagas Sanjaya <bagasdotme@gmail.com> Link: https://lore.kernel.org/r/20240413002522.1101315-9-pasha.tatashin@soleen.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 5404cca commit cb06b25

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/iommu/sun50i-iommu.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include <linux/spinlock.h>
2727
#include <linux/types.h>
2828

29+
#include "iommu-pages.h"
30+
2931
#define IOMMU_RESET_REG 0x010
3032
#define IOMMU_RESET_RELEASE_ALL 0xffffffff
3133
#define IOMMU_ENABLE_REG 0x020
@@ -679,8 +681,7 @@ sun50i_iommu_domain_alloc_paging(struct device *dev)
679681
if (!sun50i_domain)
680682
return NULL;
681683

682-
sun50i_domain->dt = (u32 *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
683-
get_order(DT_SIZE));
684+
sun50i_domain->dt = iommu_alloc_pages(GFP_KERNEL, get_order(DT_SIZE));
684685
if (!sun50i_domain->dt)
685686
goto err_free_domain;
686687

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

705-
free_pages((unsigned long)sun50i_domain->dt, get_order(DT_SIZE));
706+
iommu_free_pages(sun50i_domain->dt, get_order(DT_SIZE));
706707
sun50i_domain->dt = NULL;
707708

708709
kfree(sun50i_domain);

0 commit comments

Comments
 (0)