From patchwork Thu Aug 5 08:28:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12420629 X-Patchwork-Delegate: robh@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDF48C4338F for ; Thu, 5 Aug 2021 08:29:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CB60610FC for ; Thu, 5 Aug 2021 08:29:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239462AbhHEI3X (ORCPT ); Thu, 5 Aug 2021 04:29:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:44512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233871AbhHEI3W (ORCPT ); Thu, 5 Aug 2021 04:29:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 14D1C60F43; Thu, 5 Aug 2021 08:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628152149; bh=yWq8YLyiFewgrTfnETHlC/L3kFIsqG78OX2q0kQmbRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g1WNQnAWBAGniaPG60IxnhgbSvUpwPf//+BZ4Drhtsr9Kny8e3rr5vx0p14xA9JYI RBn3IyV/9yTx5/SsEpeZ43GVz/0Z1uMqEPJDyRe5zaJSgAjZW1cFEyRIP1ZvjvmEWG dsK3PA0DekE77A64g3OTdV9CYyl/dZrOF+L9cUj/dmAJ99mKIAg1WVCXhhjhm8h1YR lz4RNycAKYMqKkzI6zEUDDYYWkxZWdh1yJxZz9eWUEic0TuDDVn4y2ssb0IkEPeypY Jw0YL9tHl2eg+5ZLfUqh98ZR22Jjxz1IKbLoYL4whDoDpzB2LZ6QBViZvFzbsG2ve4 Fn/U+cJr+PPZQ== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mBYkP-001DuY-UI; Thu, 05 Aug 2021 10:29:01 +0200 From: Mauro Carvalho Chehab To: Rob Herring Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH 2/3] PCI: of: Setup PCI before setting the OF node Date: Thu, 5 Aug 2021 10:28:59 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org With this change, it is easier to add a debug printk at pci_set_of_node() in order to address possible issues. Signed-off-by: Mauro Carvalho Chehab --- drivers/pci/probe.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 79177ac37880..c5dfc1afb1d3 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2374,15 +2374,14 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn) dev->vendor = l & 0xffff; dev->device = (l >> 16) & 0xffff; - pci_set_of_node(dev); - if (pci_setup_device(dev)) { - pci_release_of_node(dev); pci_bus_put(dev->bus); kfree(dev); return NULL; } + pci_set_of_node(dev); + return dev; }