@@ -1235,19 +1235,13 @@ static phys_addr_t exynos_iommu_iova_to_phys(struct iommu_domain *iommu_domain,
1235
1235
return phys ;
1236
1236
}
1237
1237
1238
- static int exynos_iommu_add_device (struct device * dev )
1238
+ static struct iommu_device * exynos_iommu_probe_device (struct device * dev )
1239
1239
{
1240
1240
struct exynos_iommu_owner * owner = dev -> archdata .iommu ;
1241
1241
struct sysmmu_drvdata * data ;
1242
- struct iommu_group * group ;
1243
1242
1244
1243
if (!has_sysmmu (dev ))
1245
- return - ENODEV ;
1246
-
1247
- group = iommu_group_get_for_dev (dev );
1248
-
1249
- if (IS_ERR (group ))
1250
- return PTR_ERR (group );
1244
+ return ERR_PTR (- ENODEV );
1251
1245
1252
1246
list_for_each_entry (data , & owner -> controllers , owner_node ) {
1253
1247
/*
@@ -1259,17 +1253,15 @@ static int exynos_iommu_add_device(struct device *dev)
1259
1253
DL_FLAG_STATELESS |
1260
1254
DL_FLAG_PM_RUNTIME );
1261
1255
}
1262
- iommu_group_put (group );
1263
1256
1264
1257
/* There is always at least one entry, see exynos_iommu_of_xlate() */
1265
1258
data = list_first_entry (& owner -> controllers ,
1266
1259
struct sysmmu_drvdata , owner_node );
1267
- iommu_device_link (& data -> iommu , dev );
1268
1260
1269
- return 0 ;
1261
+ return & data -> iommu ;
1270
1262
}
1271
1263
1272
- static void exynos_iommu_remove_device (struct device * dev )
1264
+ static void exynos_iommu_release_device (struct device * dev )
1273
1265
{
1274
1266
struct exynos_iommu_owner * owner = dev -> archdata .iommu ;
1275
1267
struct sysmmu_drvdata * data ;
@@ -1287,15 +1279,9 @@ static void exynos_iommu_remove_device(struct device *dev)
1287
1279
iommu_group_put (group );
1288
1280
}
1289
1281
}
1290
- iommu_group_remove_device (dev );
1291
1282
1292
1283
list_for_each_entry (data , & owner -> controllers , owner_node )
1293
1284
device_link_del (data -> link );
1294
-
1295
- /* There is always at least one entry, see exynos_iommu_of_xlate() */
1296
- data = list_first_entry (& owner -> controllers ,
1297
- struct sysmmu_drvdata , owner_node );
1298
- iommu_device_unlink (& data -> iommu , dev );
1299
1285
}
1300
1286
1301
1287
static int exynos_iommu_of_xlate (struct device * dev ,
@@ -1341,8 +1327,8 @@ static const struct iommu_ops exynos_iommu_ops = {
1341
1327
.unmap = exynos_iommu_unmap ,
1342
1328
.iova_to_phys = exynos_iommu_iova_to_phys ,
1343
1329
.device_group = generic_device_group ,
1344
- .add_device = exynos_iommu_add_device ,
1345
- .remove_device = exynos_iommu_remove_device ,
1330
+ .probe_device = exynos_iommu_probe_device ,
1331
+ .release_device = exynos_iommu_release_device ,
1346
1332
.pgsize_bitmap = SECT_SIZE | LPAGE_SIZE | SPAGE_SIZE ,
1347
1333
.of_xlate = exynos_iommu_of_xlate ,
1348
1334
};
0 commit comments