From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: kernel@pengutronix.de,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-pci@vger.kernel.org
Subject: [PATCH v2 2/6] PCI: Drop useless check from pci_device_probe()
Date: Tue, 3 Aug 2021 12:01:46 +0200 [thread overview]
Message-ID: <20210803100150.1543597-3-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20210803100150.1543597-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
next prev parent reply other threads:[~2021-08-03 10:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-03 10:01 [PATCH v2 0/6] PCI: Drop duplicated tracking of a pci_dev's bound driver Uwe Kleine-König
2021-08-03 10:01 ` [PATCH v2 1/6] PCI: Simplify pci_device_remove() Uwe Kleine-König
2021-08-03 10:01 ` Uwe Kleine-König [this message]
2021-08-03 10:01 ` [PATCH v2 3/6] xen/pci: Drop some checks that are always true Uwe Kleine-König
2021-08-03 13:50 ` Boris Ostrovsky
2021-08-03 10:01 ` [PATCH v2 4/6] PCI: Provide wrapper to access a pci_dev's bound driver Uwe Kleine-König
2021-08-03 14:37 ` Andy Shevchenko
2021-08-03 10:01 ` [PATCH v2 5/6] PCI: Adapt all code locations to not use struct pci_dev::driver directly Uwe Kleine-König
2021-08-03 13:53 ` Boris Ostrovsky
2021-08-03 14:38 ` Andy Shevchenko
2021-08-03 14:46 ` Ido Schimmel
2021-08-05 15:09 ` Andrew Donnellan
2021-08-03 10:01 ` [PATCH v2 6/6] PCI: Drop duplicated tracking of a pci_dev's bound driver Uwe Kleine-König
2021-08-05 23:42 ` [PATCH v2 0/6] " Bjorn Helgaas
2021-08-06 6:46 ` Uwe Kleine-König
2021-08-06 21:24 ` Bjorn Helgaas
2021-08-07 9:26 ` Uwe Kleine-König
2021-08-09 18:14 ` Bjorn Helgaas
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=20210803100150.1543597-3-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=bhelgaas@google.com \
--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).