All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: Take __pci_set_master in do_pci_disable_device
@ 2021-02-14 11:06 Minwoo Im
  2021-02-14 18:12 ` Krzysztof Wilczyński
  0 siblings, 1 reply; 7+ messages in thread
From: Minwoo Im @ 2021-02-14 11:06 UTC (permalink / raw)
  To: linux-pci; +Cc: Bjorn Helgaas, Minwoo Im

__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@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-05  5:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14 11:06 [PATCH] PCI: Take __pci_set_master in do_pci_disable_device Minwoo Im
2021-02-14 18:12 ` Krzysztof Wilczyński
2021-02-15 13:22   ` Minwoo Im
2021-02-24 22:46     ` Krzysztof Wilczyński
2021-03-04  4:40       ` Minwoo Im
2021-03-04 12:11         ` Bjorn Helgaas
2021-03-05  5:17           ` Minwoo Im

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.