diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-10-12 23:11:24 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-10-18 16:20:15 +0200 |
commit | 2a4d9408c9e8b6f6fc150c66f3fef755c9e20d4a (patch) | |
tree | 199c2d2274b02bbb5e702ba124565c868fd1e069 /drivers/pci/pcie/err.c | |
parent | x86/pci/probe_roms: Use to_pci_driver() instead of pci_dev->driver (diff) | |
download | linux-2a4d9408c9e8b6f6fc150c66f3fef755c9e20d4a.tar.xz linux-2a4d9408c9e8b6f6fc150c66f3fef755c9e20d4a.zip |
PCI: Use to_pci_driver() instead of pci_dev->driver
Struct pci_driver contains a struct device_driver, so for PCI devices, it's
easy to convert a device_driver * to a pci_driver * with to_pci_driver().
The device_driver * is in struct device, so we don't need to also keep
track of the pci_driver * in struct pci_dev.
Replace pci_dev->driver with to_pci_driver(). This is a step toward
removing pci_dev->driver.
[bhelgaas: split to separate patch]
Link: https://lore.kernel.org/r/20211004125935.2300113-11-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pcie/err.c')
-rw-r--r-- | drivers/pci/pcie/err.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index 0c5a143025af..356b9317297e 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -54,7 +54,7 @@ static int report_error_detected(struct pci_dev *dev, const struct pci_error_handlers *err_handler; device_lock(&dev->dev); - pdrv = dev->driver; + pdrv = to_pci_driver(dev->dev.driver); if (!pci_dev_set_io_state(dev, state) || !pdrv || !pdrv->err_handler || @@ -98,7 +98,7 @@ static int report_mmio_enabled(struct pci_dev *dev, void *data) const struct pci_error_handlers *err_handler; device_lock(&dev->dev); - pdrv = dev->driver; + pdrv = to_pci_driver(dev->dev.driver); if (!pdrv || !pdrv->err_handler || !pdrv->err_handler->mmio_enabled) @@ -119,7 +119,7 @@ static int report_slot_reset(struct pci_dev *dev, void *data) const struct pci_error_handlers *err_handler; device_lock(&dev->dev); - pdrv = dev->driver; + pdrv = to_pci_driver(dev->dev.driver); if (!pdrv || !pdrv->err_handler || !pdrv->err_handler->slot_reset) @@ -139,7 +139,7 @@ static int report_resume(struct pci_dev *dev, void *data) const struct pci_error_handlers *err_handler; device_lock(&dev->dev); - pdrv = dev->driver; + pdrv = to_pci_driver(dev->dev.driver); if (!pci_dev_set_io_state(dev, pci_channel_io_normal) || !pdrv || !pdrv->err_handler || |