Skip to content

Commit 2f48b1d

Browse files
yuliao0214kuba-moo
authored andcommitted
pds_core: remove redundant pci_clear_master()
do_pci_disable_device() disable PCI bus-mastering as following: 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 pci_disable_device() sets dev->is_busmaster to 0. pci_enable_device() is called only once before calling to pci_disable_device() and such pci_clear_master() is not needed. So remove redundant pci_clear_master(). Also rename goto label 'err_out_clear_master' to 'err_out_disable_device'. Signed-off-by: Yu Liao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Acked-by: Shannon Nelson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 74f9d55 commit 2f48b1d

File tree

1 file changed

+2
-4
lines changed
  • drivers/net/ethernet/amd/pds_core

1 file changed

+2
-4
lines changed

drivers/net/ethernet/amd/pds_core/main.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,13 @@ static int pdsc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
367367
err = pdsc_init_vf(pdsc);
368368
if (err) {
369369
dev_err(dev, "Cannot init device: %pe\n", ERR_PTR(err));
370-
goto err_out_clear_master;
370+
goto err_out_disable_device;
371371
}
372372

373373
clear_bit(PDSC_S_INITING_DRIVER, &pdsc->state);
374374
return 0;
375375

376-
err_out_clear_master:
377-
pci_clear_master(pdev);
376+
err_out_disable_device:
378377
pci_disable_device(pdev);
379378
err_out_free_ida:
380379
ida_free(&pdsc_ida, pdsc->uid);
@@ -439,7 +438,6 @@ static void pdsc_remove(struct pci_dev *pdev)
439438
pci_release_regions(pdev);
440439
}
441440

442-
pci_clear_master(pdev);
443441
pci_disable_device(pdev);
444442

445443
ida_free(&pdsc_ida, pdsc->uid);

0 commit comments

Comments
 (0)