oops, sorry, i see, this is not needed because device_group() is only be called when iommu_group_get() returns NULLright, it's allocated in the probe.
+static struct iommu_group *rk_iommu_device_group(struct device *dev)
+{
+ struct iommu_group *group;
+ int ret;
+
+ group = iommu_group_get(dev);
+ if (!group) {
This check is pointless - if dev->iommu_group were non-NULL you wouldn't
have been called in the first place.