Skip to content

Commit da6b4dc

Browse files
caihuoqjonmason
authored andcommitted
ntb_hw_amd: Remove redundant pci_clear_master
Remove pci_clear_master to simplify the code, the bus-mastering is also cleared in do_pci_disable_device, like this: ./drivers/pci/pci.c:2197 static void do_pci_disable_device(struct pci_dev *dev) { u16 pci_command; pci_read_config_word(dev, PCI_COMMAND, &pci_command); if (pci_command & PCI_COMMAND_MASTER) { pci_command &= ~PCI_COMMAND_MASTER; pci_write_config_word(dev, PCI_COMMAND, pci_command); } pcibios_disable_device(dev); }. And dev->is_busmaster is set to 0 in pci_disable_device. Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev> Signed-off-by: Jon Mason <jdmason@kudzu.us>
1 parent cb2a6d1 commit da6b4dc

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/ntb/hw/amd/ntb_hw_amd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,6 @@ static int amd_ntb_init_pci(struct amd_ntb_dev *ndev,
11941194
return 0;
11951195

11961196
err_dma_mask:
1197-
pci_clear_master(pdev);
11981197
pci_release_regions(pdev);
11991198
err_pci_regions:
12001199
pci_disable_device(pdev);
@@ -1209,7 +1208,6 @@ static void amd_ntb_deinit_pci(struct amd_ntb_dev *ndev)
12091208

12101209
pci_iounmap(pdev, ndev->self_mmio);
12111210

1212-
pci_clear_master(pdev);
12131211
pci_release_regions(pdev);
12141212
pci_disable_device(pdev);
12151213
pci_set_drvdata(pdev, NULL);

0 commit comments

Comments
 (0)