From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
linux-pci@vger.kernel.org, kernel@pengutronix.de
Subject: [PATCH v5 11/11] PCI: Drop duplicated tracking of a pci_dev's bound driver
Date: Wed, 29 Sep 2021 10:53:06 +0200 [thread overview]
Message-ID: <20210929085306.2203850-12-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20210929085306.2203850-1-u.kleine-koenig@pengutronix.de>
Currently it's tracked twice which driver is bound to a given pci
device. Now that all users of the pci specific one (struct
pci_dev::driver) are updated to use an access macro
(pci_driver_of_dev()), change the macro to use the information from the
driver core and remove the driver member from struct pci_dev.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/pci/pci-driver.c | 4 ----
include/linux/pci.h | 1 -
2 files changed, 5 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 4d20022b8631..e70cd432de06 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -319,12 +319,10 @@ static long local_pci_probe(void *_ddi)
* its remove routine.
*/
pm_runtime_get_sync(dev);
- pci_dev->driver = pci_drv;
rc = pci_drv->probe(pci_dev, ddi->id);
if (!rc)
return rc;
if (rc < 0) {
- pci_dev->driver = NULL;
pm_runtime_put_sync(dev);
return rc;
}
@@ -390,7 +388,6 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
* @pci_dev: PCI device being probed
*
* returns 0 on success, else error.
- * side-effect: pci_dev->driver is set to drv when drv claims pci_dev.
*/
static int __pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev)
{
@@ -465,7 +462,6 @@ static void pci_device_remove(struct device *dev)
pm_runtime_put_noidle(dev);
}
pcibios_free_irq(pci_dev);
- pci_dev->driver = NULL;
pci_iov_remove(pci_dev);
/* Undo the runtime PM settings in local_pci_probe() */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index cd8aa6fce204..7c1ceb39035c 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -342,7 +342,6 @@ struct pci_dev {
u16 pcie_flags_reg; /* Cached PCIe Capabilities Register */
unsigned long *dma_alias_mask;/* Mask of enabled devfn aliases */
- struct pci_driver *driver; /* Driver bound to this device */
u64 dma_mask; /* Mask of the bits of bus address this
device implements. Normally this is
0xffffffff. You only need to change
--
2.30.2
prev parent reply other threads:[~2021-09-29 8:53 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-29 8:52 [PATCH v5 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver Uwe Kleine-König
2021-09-29 8:52 ` Uwe Kleine-König
2021-09-29 8:52 ` [PATCH v5 01/11] PCI: Simplify pci_device_remove() Uwe Kleine-König
2021-09-29 8:52 ` [PATCH v5 02/11] PCI: Drop useless check from pci_device_probe() Uwe Kleine-König
2021-09-29 8:52 ` [PATCH v5 03/11] xen/pci: Drop some checks that are always true Uwe Kleine-König
2021-09-29 8:52 ` [PATCH v5 04/11] bcma: simplify reference to the driver's name Uwe Kleine-König
2021-09-29 8:53 ` [PATCH v5 05/11] powerpc/eeh: Don't use driver member of struct pci_dev and further cleanups Uwe Kleine-König
2021-09-29 8:53 ` Uwe Kleine-König
2021-09-29 8:53 ` [PATCH v5 06/11] ssb: Simplify determination of driver name Uwe Kleine-König
2021-09-29 11:13 ` Michael Büsch
2021-09-29 8:53 ` [PATCH v5 07/11] PCI: Replace pci_dev::driver usage that gets the " Uwe Kleine-König
2021-09-29 8:53 ` Uwe Kleine-König
2021-09-29 10:17 ` Simon Horman
2021-09-29 10:17 ` Simon Horman
2021-09-29 14:44 ` Ido Schimmel
2021-09-29 14:44 ` Ido Schimmel
2021-09-29 15:21 ` Ido Schimmel
2021-09-29 15:21 ` Ido Schimmel
2021-09-29 8:53 ` [PATCH v5 08/11] scsi: message: fusion: Remove unused parameter of mpt_pci driver's probe() Uwe Kleine-König
2021-09-29 8:53 ` [PATCH v5 09/11] crypto: qat - simplify adf_enable_aer() Uwe Kleine-König
2021-09-29 8:53 ` [PATCH v5 10/11] PCI: Replace pci_dev::driver usage by pci_dev::dev.driver Uwe Kleine-König
2021-09-29 8:53 ` Uwe Kleine-König
2021-09-29 13:15 ` Andrew Donnellan
2021-09-29 13:15 ` Andrew Donnellan
2021-09-29 13:43 ` Uwe Kleine-König
2021-09-29 13:43 ` Uwe Kleine-König
2021-09-29 15:44 ` Andrew Donnellan
2021-09-29 15:44 ` Andrew Donnellan
2021-09-30 13:48 ` Frederic Barrat
2021-09-30 13:48 ` Frederic Barrat
2021-09-29 8:53 ` Uwe Kleine-König [this message]
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=20210929085306.2203850-12-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=hch@lst.de \
--cc=helgaas@kernel.org \
--cc=kernel@pengutronix.de \
--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 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.