mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>
Cc: <bhelgaas@google.com>
Subject: [PATCH -next 2/2] PCI: switch to use dev_err_probe()
Date: Wed, 17 Aug 2022 16:44:44 +0800	[thread overview]
Message-ID: <20220817084444.2876059-2-yangyingliang@huawei.com> (raw)
In-Reply-To: <20220817084444.2876059-1-yangyingliang@huawei.com>

Use dev_err_probe() to simplify code and print error code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/pci/probe.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 0e947f24153e..f2430da8a30b 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -3054,10 +3054,9 @@ int pci_host_probe(struct pci_host_bridge *bridge)
 	int ret;
 
 	ret = pci_scan_root_bus_bridge(bridge);
-	if (ret < 0) {
-		dev_err(bridge->dev.parent, "Scanning root bridge failed");
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(bridge->dev.parent, ret,
+				     "Scanning root bridge failed");
 
 	bus = bridge->bus;
 
-- 
2.25.1


  reply	other threads:[~2022-08-17  8:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17  8:44 [PATCH -next 1/2] PCI: fix possible memory leak in error case in pci_setup_device() Yang Yingliang
2022-08-17  8:44 ` Yang Yingliang [this message]
2022-08-17  9:11   ` [PATCH -next 2/2] PCI: switch to use dev_err_probe() Christophe JAILLET

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=20220817084444.2876059-2-yangyingliang@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®