diff mbox series

[v3,2/8] PCI: Drop useless check from pci_device_probe()

Message ID 20210811080637.2596434-3-u.kleine-koenig@pengutronix.de (mailing list archive)
State Superseded
Delegated to: Bjorn Helgaas
Headers show
Series PCI: Drop duplicated tracking of a pci_dev's bound driver | expand

Commit Message

Uwe Kleine-König Aug. 11, 2021, 8:06 a.m. UTC
When the device core calls the probe callback for a device the device is
never bound and so !pci_dev->driver is always true.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pci/pci-driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig Aug. 12, 2021, 6:46 a.m. UTC | #1
On Wed, Aug 11, 2021 at 10:06:31AM +0200, Uwe Kleine-K??nig wrote:
> When the device core calls the probe callback for a device the device is
> never bound and so !pci_dev->driver is always true.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 5808fc6f258e..7dff574bb2fa 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -383,7 +383,7 @@  static int __pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev)
 	const struct pci_device_id *id;
 	int error = 0;
 
-	if (!pci_dev->driver && drv->probe) {
+	if (drv->probe) {
 		error = -ENODEV;
 
 		id = pci_match_device(drv, pci_dev);