On Thu, Oct 29, 2020 at 03:34:48PM +0000, Robin Murphy wrote: > A common idiom for .of_xlate is to use of_find_device_by_node() to > retrieve the relevant IOMMU instance data when translating IOMMU > specifiers for a client device. Although it's slightly roundabout, > this is simply looking up something we know exists - if it *were* > to return NULL, that would mean that no platform device is associated > with the given DT node, therefore the driver couldn't have probed > and called iommu_device_register() with the ops that .of_xlate was > called from in the first place. By construction, we can also assume > that the instance data for any registered IOMMU must be valid. > > This isn't necessarily obvious at first glance, though, so add some > comments to document these assumptions in-place. > > Suggested-by: Yu Kuai <yuku...@huawei.com> > Signed-off-by: Robin Murphy <robin.mur...@arm.com>
Acked-by: Maxime Ripard <mrip...@kernel.org> Thanks! Maxime
signature.asc
Description: PGP signature
_______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu