10
10
#include <linux/compiler.h>
11
11
#include <linux/delay.h>
12
12
#include <linux/device.h>
13
- #include <linux/dma-iommu.h>
14
13
#include <linux/dma-mapping.h>
15
14
#include <linux/errno.h>
16
15
#include <linux/interrupt.h>
@@ -1074,18 +1073,14 @@ static struct iommu_domain *rk_iommu_domain_alloc(unsigned type)
1074
1073
if (!rk_domain )
1075
1074
return NULL ;
1076
1075
1077
- if (type == IOMMU_DOMAIN_DMA &&
1078
- iommu_get_dma_cookie (& rk_domain -> domain ))
1079
- goto err_free_domain ;
1080
-
1081
1076
/*
1082
1077
* rk32xx iommus use a 2 level pagetable.
1083
1078
* Each level1 (dt) and level2 (pt) table has 1024 4-byte entries.
1084
1079
* Allocate one 4 KiB page for each table.
1085
1080
*/
1086
1081
rk_domain -> dt = (u32 * )get_zeroed_page (GFP_KERNEL | GFP_DMA32 );
1087
1082
if (!rk_domain -> dt )
1088
- goto err_put_cookie ;
1083
+ goto err_free_domain ;
1089
1084
1090
1085
rk_domain -> dt_dma = dma_map_single (dma_dev , rk_domain -> dt ,
1091
1086
SPAGE_SIZE , DMA_TO_DEVICE );
@@ -1106,9 +1101,6 @@ static struct iommu_domain *rk_iommu_domain_alloc(unsigned type)
1106
1101
1107
1102
err_free_dt :
1108
1103
free_page ((unsigned long )rk_domain -> dt );
1109
- err_put_cookie :
1110
- if (type == IOMMU_DOMAIN_DMA )
1111
- iommu_put_dma_cookie (& rk_domain -> domain );
1112
1104
err_free_domain :
1113
1105
kfree (rk_domain );
1114
1106
@@ -1137,8 +1129,6 @@ static void rk_iommu_domain_free(struct iommu_domain *domain)
1137
1129
SPAGE_SIZE , DMA_TO_DEVICE );
1138
1130
free_page ((unsigned long )rk_domain -> dt );
1139
1131
1140
- if (domain -> type == IOMMU_DOMAIN_DMA )
1141
- iommu_put_dma_cookie (& rk_domain -> domain );
1142
1132
kfree (rk_domain );
1143
1133
}
1144
1134
0 commit comments