File tree Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -1081,31 +1081,24 @@ static int ipmmu_probe(struct platform_device *pdev)
1081
1081
}
1082
1082
}
1083
1083
1084
+ platform_set_drvdata (pdev , mmu );
1084
1085
/*
1085
1086
* Register the IPMMU to the IOMMU subsystem in the following cases:
1086
1087
* - R-Car Gen2 IPMMU (all devices registered)
1087
1088
* - R-Car Gen3 IPMMU (leaf devices only - skip root IPMMU-MM device)
1088
1089
*/
1089
- if (!mmu -> features -> has_cache_leaf_nodes || !ipmmu_is_root (mmu )) {
1090
- ret = iommu_device_sysfs_add (& mmu -> iommu , & pdev -> dev , NULL ,
1091
- dev_name (& pdev -> dev ));
1092
- if (ret )
1093
- return ret ;
1094
-
1095
- ret = iommu_device_register (& mmu -> iommu , & ipmmu_ops , & pdev -> dev );
1096
- if (ret )
1097
- return ret ;
1098
- }
1090
+ if (mmu -> features -> has_cache_leaf_nodes && ipmmu_is_root (mmu ))
1091
+ return 0 ;
1099
1092
1100
- /*
1101
- * We can't create the ARM mapping here as it requires the bus to have
1102
- * an IOMMU, which only happens when bus_set_iommu() is called in
1103
- * ipmmu_init() after the probe function returns.
1104
- */
1093
+ ret = iommu_device_sysfs_add (& mmu -> iommu , & pdev -> dev , NULL , dev_name (& pdev -> dev ));
1094
+ if (ret )
1095
+ return ret ;
1105
1096
1106
- platform_set_drvdata (pdev , mmu );
1097
+ ret = iommu_device_register (& mmu -> iommu , & ipmmu_ops , & pdev -> dev );
1098
+ if (ret )
1099
+ iommu_device_sysfs_remove (& mmu -> iommu );
1107
1100
1108
- return 0 ;
1101
+ return ret ;
1109
1102
}
1110
1103
1111
1104
static void ipmmu_remove (struct platform_device * pdev )
You can’t perform that action at this time.
0 commit comments