PCI/P2PDMA: Use DMA ops setter instead of direct assignment
Subsystems (2)
PATCH 1/1 PCI/P2PDMA: Use DMA ops setter instead of direct assignment
Use DMA ops setter instead of direct assignment. Even we know that this module doesn't perform access to the dma_ops member of struct device, it's better to use setter to avoid potential problems in the future.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/pci/p2pdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/p2pdma.c +2 -2
@@ -557,7 +557,7 @@ int pci_p2pdma_distance_many(struct pci_dev *provider, struct device **clients,for (i =0 ; i < num_clients; i++) {#ifdef CONFIG_DMA_VIRT_OPS -if (clients[i]->dma_ops == &dma_virt_ops) { +if (get_dma_ops (clients[i]) == &dma_virt_ops) {if (verbose)dev_warn (clients[i],"cannot be used for peer-to-peer DMA because the driver makes use of dma_virt_ops\n" );
@@ -844,7 +844,7 @@ static int __pci_p2pdma_map_sg(struct pci_p2pdma_pagemap *p2p_pgmap,* by the check in pci_p2pdma_distance_many() */ #ifdef CONFIG_DMA_VIRT_OPS -if (WARN_ON_ONCE (dev->dma_ops == &dma_virt_ops)) +if (WARN_ON_ONCE (get_dma_ops (dev) == &dma_virt_ops))return 0 ;#endif
Signature · 1 line
2.28.0
Quoted 5 lines · Andy Shevchenko
Use DMA ops setter instead of direct assignment. Even we know that this module doesn't perform access to the
dma_opsmember of struct device, it's better to use setter to avoid potential problems in the future.Signed-off-by Andy Shevchenko <[email protected]>
As mentioned in reply to the intel-iommu patch: I plan to remove these accessors soon.