linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	kernel@pengutronix.de,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-pci@vger.kernel.org
Subject: [PATCH v1 2/5] PCI: Drop useless check from pci_device_probe()
Date: Thu, 29 Jul 2021 22:37:37 +0200	[thread overview]
Message-ID: <20210729203740.1377045-3-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20210729203740.1377045-1-u.kleine-koenig@pengutronix.de>

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(-)

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);
-- 
2.30.2


  parent reply	other threads:[~2021-07-29 20:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 20:37 [PATCH v1 0/5] PCI: Drop duplicated tracking of a pci_dev's bound driver Uwe Kleine-König
2021-07-29 20:37 ` [PATCH v1 1/5] PCI: Simplify pci_device_remove() Uwe Kleine-König
2021-07-29 20:37 ` Uwe Kleine-König [this message]
2021-07-29 20:37 ` [PATCH v1 3/5] PCI: Provide wrapper to access a pci_dev's bound driver Uwe Kleine-König
2021-07-29 20:37 ` [PATCH v1 4/5] PCI: Adapt all code locations to not use struct pci_dev::driver directly Uwe Kleine-König
2021-07-30 20:37   ` Boris Ostrovsky
2021-07-31 12:08     ` Uwe Kleine-König
2021-08-02 13:06       ` Boris Ostrovsky
2021-07-29 20:37 ` [PATCH v1 5/5] PCI: Drop duplicated tracking of a pci_dev's bound driver Uwe Kleine-König
2021-07-30  5:14   ` Greg Kroah-Hartman
2021-07-30  5:24     ` Uwe Kleine-König
2021-07-30  5:14 ` [PATCH v1 0/5] " Greg Kroah-Hartman
2021-07-30  8:06 ` Andy Shevchenko
2021-07-30 17:48   ` Uwe Kleine-König

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=20210729203740.1377045-3-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=bhelgaas@google.com \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).