From patchwork Fri Aug 21 03:53:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 257361 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=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 9D550C433F1 for ; Fri, 21 Aug 2020 03:55:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 734E520714 for ; Fri, 21 Aug 2020 03:55:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597982129; bh=dm8W+tDkYxpPrQtWredGQ/rIh9vixl0V3X1tJZ50sog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0sv+ndj/YUfKdLyS8mrxYyLR5WUi1Efzc4LV0xArNGHDtYH4heJX1M+BBmTfHC5pK lY9L88u6K+iJ4mB5ord3fp/qYzPj/fLFx98gTSfxJxxouRUvxqGY3ARGWzUStVUQx1 tAWTAu/9/wzVWHztKscecZbyLrpL6DFdqFY5uzNw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727909AbgHUDz1 (ORCPT ); Thu, 20 Aug 2020 23:55:27 -0400 Received: from mail-il1-f193.google.com ([209.85.166.193]:42910 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727891AbgHUDzX (ORCPT ); Thu, 20 Aug 2020 23:55:23 -0400 Received: by mail-il1-f193.google.com with SMTP id t13so325099ile.9; Thu, 20 Aug 2020 20:55:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OdbUqaHlOxpNwKxtKQG+iMJdH7wgWqKuZeq7kbv/krA=; b=kmV2xK/BLLTPhH15I9jfXaPiyJmB00p1SW+FQs57LskvZ7TnwJ/p2FPIl1YxBnuVFJ hHqKcrIetHIo7XJHR49cMin2PAB5KFMlsY4j4JZhilvrbVQZpymDynEU7PQ8Kb3LzY3j A551rOshu7FlkKdH++7SLNaBQ/sXzp13h4LVt7LRMHte+T2AMi68n8gP2dcGOFAcEJcE AmZuYA9LKbSLecdmVQkET+Y6ZiKA0XuDLjCm9IauDy7gSg3uQR5udTZ6sx0DE8LxggnG HY3nRwklzQWoD9JdN9K1ZmxDyInoo/+wg7CeIqGk5KQbwdMWzGqv9htxt6N6mkYfvpVJ bQpA== X-Gm-Message-State: AOAM532MwvaKziVSdgroWY7TAt/rlbVr48mo/OFNr7GT/ABKOqZv/jfd rkUGA+Kkql2inzE4yw+iaw== X-Google-Smtp-Source: ABdhPJwE4917c5+NGuqLlyA9JDGlrpGe+mH9Eho+5KNlJKwz9WZvaxODvXKvQEAkENi0q4FM4lOqPw== X-Received: by 2002:a92:ad12:: with SMTP id w18mr941662ilh.218.1597982121701; Thu, 20 Aug 2020 20:55:21 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.249]) by smtp.googlemail.com with ESMTPSA id 79sm413923ilc.9.2020.08.20.20.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2020 20:55:21 -0700 (PDT) From: Rob Herring To: Bjorn Helgaas , Lorenzo Pieralisi Cc: linux-pci@vger.kernel.org, Andy Gross , Binghui Wang , Bjorn Andersson , Dilip Kota , Fabio Estevam , Gustavo Pimentel , Jerome Brunet , Jesper Nilsson , Jingoo Han , Jonathan Chocron , Jonathan Hunter , Kevin Hilman , Kishon Vijay Abraham I , Krzysztof Kozlowski , Kukjin Kim , Kunihiko Hayashi , Lucas Stach , Martin Blumenstingl , Masahiro Yamada , Murali Karicheri , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Pratyush Anand , Richard Zhu , Sascha Hauer , Shawn Guo , Shawn Guo , Stanimir Varbanov , Thierry Reding , Xiaowei Song , Yue Wang , Marc Zyngier , linux-amlogic@lists.infradead.org, linux-arm-kernel@axis.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 14/40] PCI: Also call .add_bus() callback for root bus Date: Thu, 20 Aug 2020 21:53:54 -0600 Message-Id: <20200821035420.380495-15-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200821035420.380495-1-robh@kernel.org> References: <20200821035420.380495-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Similar to pcibios_add_bus(), call pci_ops.add_bus() when the root bus is added. This allows host bridge drivers to do any setup requiring a bus pointer. There are currently no .add_bus() callbacks, so this is safe to do. Cc: Bjorn Helgaas Signed-off-by: Rob Herring --- drivers/pci/probe.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 0c9ebc72532e..d8bf3fe8dacd 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -941,6 +941,12 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge) pcibios_add_bus(bus); + if (bus->ops->add_bus) { + err = bus->ops->add_bus(bus); + if (WARN_ON(err < 0)) + dev_err(&bus->dev, "failed to add bus: %d\n", err); + } + /* Create legacy_io and legacy_mem files for this bus */ pci_create_legacy_files(bus);