[PATCH] PCI: Take __pci_set_master in do_pci_disable_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



__pci_set_mater() has debug log in there so that it would be better to
take this function.  So take __pci_set_master() function rather than
open coding it.  This patch didn't move __pci_set_master() to above to
avoid churns.

Signed-off-by: Minwoo Im <minwoo.im.dev@xxxxxxxxx>
---
 drivers/pci/pci.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index b9fecc25d213..b2778f475ce3 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2101,15 +2101,10 @@ void __weak pcibios_disable_device(struct pci_dev *dev) {}
  */
 void __weak pcibios_penalize_isa_irq(int irq, int active) {}
 
+static void __pci_set_master(struct pci_dev *dev, bool enable);
 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);
-	}
+	__pci_set_master(dev, false);
 
 	pcibios_disable_device(dev);
 }
-- 
2.17.1




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux