From patchwork Wed Nov 12 02:42:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 5282671 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8C193C11AC for ; Wed, 12 Nov 2014 02:43:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5C6820142 for ; Wed, 12 Nov 2014 02:42:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED99620127 for ; Wed, 12 Nov 2014 02:42:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933155AbaKLCmx (ORCPT ); Tue, 11 Nov 2014 21:42:53 -0500 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:48341 "EHLO e28smtp03.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932858AbaKLCmv (ORCPT ); Tue, 11 Nov 2014 21:42:51 -0500 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Nov 2014 08:12:48 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp03.in.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 12 Nov 2014 08:12:46 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 30390E003F for ; Wed, 12 Nov 2014 08:12:55 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay02.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sAC2h15K56229948 for ; Wed, 12 Nov 2014 08:13:02 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sAC2gjcS032662 for ; Wed, 12 Nov 2014 08:12:45 +0530 Received: from shangw (haven.au.ibm.com [9.192.253.15]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sAC2giEx032602; Wed, 12 Nov 2014 08:12:45 +0530 Received: by shangw (Postfix, from userid 1000) id 6ECDC3E0270; Wed, 12 Nov 2014 13:42:44 +1100 (EST) From: Gavin Shan To: linux-pci@vger.kernel.org Cc: bhelgaas@google.com, Gavin Shan Subject: [PATCH] PCI: Fix device node for virtual bus Date: Wed, 12 Nov 2014 13:42:43 +1100 Message-Id: <1415760163-12517-1-git-send-email-gwshan@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.3.2 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14111202-0009-0000-0000-00000228A234 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP pci_set_bus_of_node() sets virtual PCI bus's device node to PHB's device node wrongly. The patch fixes the issue. Signed-off-by: Gavin Shan --- drivers/pci/of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/of.c b/drivers/pci/of.c index f092993..7b2256b 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -31,9 +31,9 @@ void pci_release_of_node(struct pci_dev *dev) void pci_set_bus_of_node(struct pci_bus *bus) { - if (bus->self == NULL) + if (pci_is_root_bus(bus)) bus->dev.of_node = pcibios_get_phb_of_node(bus); - else + else if (bus->self) bus->dev.of_node = of_node_get(bus->self->dev.of_node); }