public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Minwoo Im <minwoo.im.dev@gmail.com>
To: linux-pci@vger.kernel.org
Cc: Bjorn Helgaas <bhelgaas@google.com>, Minwoo Im <minwoo.im.dev@gmail.com>
Subject: [PATCH] PCI: Take __pci_set_master in do_pci_disable_device
Date: Sun, 14 Feb 2021 20:06:37 +0900	[thread overview]
Message-ID: <20210214110637.24750-1-minwoo.im.dev@gmail.com> (raw)

__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


             reply	other threads:[~2021-02-14 11:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-14 11:06 Minwoo Im [this message]
2021-02-14 18:12 ` [PATCH] PCI: Take __pci_set_master in do_pci_disable_device 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210214110637.24750-1-minwoo.im.dev@gmail.com \
    --to=minwoo.im.dev@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox