Christoph Hellwig
2018-Apr-25 15:20 UTC
[Nouveau] [PATCH v2 3/5] ARM: dma-mapping: Implement arch_iommu_detach_device()
> +void arch_iommu_detach_device(struct device *dev) > +{ > +#ifdef CONFIG_ARM_DMA_USE_IOMMU > + struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev); > + const struct dma_map_ops *dma_ops; > + > + if (!mapping) > + return; > + > + arm_iommu_release_mapping(mapping); > + arm_iommu_detach_device(dev); > + > + dma_ops = arm_get_dma_map_ops(dev->archdata.dma_coherent); > + set_dma_ops(dev, dma_ops);Why not simply: set_dma_ops(dev, arm_get_dma_map_ops(dev->archdata.dma_coherent));
Thierry Reding
2018-Apr-26 12:14 UTC
[Nouveau] [PATCH v2 3/5] ARM: dma-mapping: Implement arch_iommu_detach_device()
On Wed, Apr 25, 2018 at 08:20:49AM -0700, Christoph Hellwig wrote:> > +void arch_iommu_detach_device(struct device *dev) > > +{ > > +#ifdef CONFIG_ARM_DMA_USE_IOMMU > > + struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev); > > + const struct dma_map_ops *dma_ops; > > + > > + if (!mapping) > > + return; > > + > > + arm_iommu_release_mapping(mapping); > > + arm_iommu_detach_device(dev); > > + > > + dma_ops = arm_get_dma_map_ops(dev->archdata.dma_coherent); > > + set_dma_ops(dev, dma_ops); > > Why not simply: > > set_dma_ops(dev, arm_get_dma_map_ops(dev->archdata.dma_coherent));I had that initially, but it looked cluttered to me, so I split it up. I don't care much either way, so I can revert to that if you prefer. Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20180426/c380f505/attachment.sig>
Possibly Parallel Threads
- [PATCH v2 3/5] ARM: dma-mapping: Implement arch_iommu_detach_device()
- [PATCH 3/4] ARM: dma-mapping: Implement arch_iommu_detach_device()
- [PATCH v2 3/5] ARM: dma-mapping: Implement arch_iommu_detach_device()
- [PATCH v2 5/5] ARM: Unconditionally enable ARM_DMA_USE_IOMMU
- [PATCH 1/4] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping