summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>2025-12-02 18:13:51 +0300
committerBjorn Helgaas <bhelgaas@google.com>2026-01-14 00:42:23 +0300
commit0c1594df40a00a1e3ce8d4ce8c17838de1ec29f2 (patch)
treecee09a4024a55fc3975eb8210d935f119c841f4b
parent15fff3b799ffa38970c6d58dc8dd0aaf3317fab7 (diff)
downloadlinux-0c1594df40a00a1e3ce8d4ce8c17838de1ec29f2.tar.xz
PCI/portdrv: Don't check for the driver's and device's bus
The driver core ensures that the match function is only called for drivers and devices of the right bus. So drop the useless check. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Link: https://patch.msgid.link/09ca261912a37d2b253f43359a5dfeec42c016dc.1764688034.git.u.kleine-koenig@baylibre.com
-rw-r--r--drivers/pci/pci-driver.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 7c2d9d596258..e6ccaf0a762f 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1704,14 +1704,8 @@ EXPORT_SYMBOL(pci_bus_type);
#ifdef CONFIG_PCIEPORTBUS
static int pcie_port_bus_match(struct device *dev, const struct device_driver *drv)
{
- struct pcie_device *pciedev;
- const struct pcie_port_service_driver *driver;
-
- if (drv->bus != &pcie_port_bus_type || dev->bus != &pcie_port_bus_type)
- return 0;
-
- pciedev = to_pcie_device(dev);
- driver = to_service_driver(drv);
+ struct pcie_device *pciedev = to_pcie_device(dev);
+ const struct pcie_port_service_driver *driver = to_service_driver(drv);
if (driver->service != pciedev->service)
return 0;