From patchwork Mon Aug 3 21:01:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 247408 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1539709ilo; Mon, 3 Aug 2020 14:01:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzbTvBsngzbanlwwPc4SVIaMso0MRb+r9uioe7OX15UPbqI+juH9KdSkUjGFrh5YxOuDXb X-Received: by 2002:a17:906:998f:: with SMTP id af15mr17726797ejc.461.1596488517662; Mon, 03 Aug 2020 14:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596488517; cv=none; d=google.com; s=arc-20160816; b=ZQFnHY8NU2DgkwzRdVgiXGd40bUXS+FsTrBKWtzD7kSYrcWg8lLziBOK80sN310Sft IcrlmALczcDHIVGwHMxMR2io1cJmKuawqRaZn7g0+nhvVtiZqlLuFGy1yHK0YydMBs9l QHkXRXj+sR23RQE+zY9SNCEhS476QTUwGDr3I44ngY9pevoAc1xmDlBsI/J1AOJItvpY 1Cc/XsRz50ahakvXwHjjtOpYFmog+E5I8TdD6rpIwDYCyV2GbaJKd66D7TcB0vxjZm90 0jlYZ3/2mIQx6NFGfhj/n8ruOeAxZSjEbWEplrh+ZzZZLBRjGSRauKNFtXDoa6xvYspm UZYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=aFafu+8WFYxvnK2ZfkQMV1ef4S4ilss7PqKLS2/JE9Q=; b=P8m9LoXpjnXpvsVn/IbrhjAc2L4s79qGqnhg+NENJWbmKTUqjR7bqlRPZEklQr5rYL 9ul4H+y8SgrFpsUQ8Yn3jIkoD0xwOHjBUj1LPGfeT1FogKVzZzORajexp1jC1mTTrDuz osbnMQDMu81I2ct3eB7/VS4mJGQ9cgIva+SkKC/AOpwzpaTRXEeqlVadawX7/jz+hMQQ 1Kgx0fjbrJ8BS+icFiPprWwmzPKqCfNzXPrbqBLa9/tmHVSnPRLs+y2F5A3URs2DkrHx SduSLH6+ap2fW0vGyC4kAHkrAgWgiGadvpj7blyhL0L9CsdxC/hJa/uvHc6IEWQkoiWo wvaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si9818208ejp.500.2020.08.03.14.01.57; Mon, 03 Aug 2020 14:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729400AbgHCVB5 (ORCPT + 4 others); Mon, 3 Aug 2020 17:01:57 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:46757 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729064AbgHCVB4 (ORCPT ); Mon, 3 Aug 2020 17:01:56 -0400 Received: by mail-io1-f68.google.com with SMTP id a5so24746443ioa.13; Mon, 03 Aug 2020 14:01:55 -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=aFafu+8WFYxvnK2ZfkQMV1ef4S4ilss7PqKLS2/JE9Q=; b=ipXeKRH+xqu0EHK9jtgf5Niv5ypGpvAs060+j9cftbVi4H/bRDhG4/dVGwvVx5JEuZ DI8dw9dThv7cLhacTBNq92rxLY3Qqzoh7rfMF94qLt0ZxFvI+9CllvwmSmmOfiyxrbey XSR3bKBJrznxUu0TYsNwB3gPWLoYuOjwEfokUuErIleQ5er6evK2ZczBC0MhtDIcydGY 0tpmW9/iqdtVlm5bhCpV4bTutf2+AyvM9vtv87nTcn9fLvkBTIoQNCSmY9hDepk/ZxV+ rm/7YMm/SApcwCfSmiEbTa5V91g1z66Tlxjjaxc0/D9V1WAEmj8TKwUtzTmMogD6gSMs ZS0w== X-Gm-Message-State: AOAM531oYEUOpJwzwHi58YBqEG0jGT3S7IVM90Y0Px592R0fgDjnsWv6 3rF5j1EwrwocnDZnjOd3cA== X-Received: by 2002:a5d:87c9:: with SMTP id q9mr1812686ios.113.1596488515619; Mon, 03 Aug 2020 14:01:55 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id r6sm9292280iod.7.2020.08.03.14.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 14:01:55 -0700 (PDT) From: Rob Herring To: Bjorn Helgaas , Gustavo Pimentel , Jingoo Han , Lorenzo Pieralisi Cc: Binghui Wang , Bjorn Andersson , Fabio Estevam , Jesper Nilsson , Jonathan Chocron , Jonathan Hunter , Kevin Hilman , Kishon Vijay Abraham I , Krzysztof Kozlowski , Kukjin Kim , Kunihiko Hayashi , 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-pci@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Lucas Stach , Masahiro Yamada , Murali Karicheri , NXP Linux Team , Pengutronix Kernel Team , Pratyush Anand , Richard Zhu , Sascha Hauer , Shawn Guo , Stanimir Varbanov , Thierry Reding , Xiaowei Song , Yue Wang Subject: [RFC 14/27] PCI: Also call .add_bus() callback for root bus Date: Mon, 3 Aug 2020 15:01:03 -0600 Message-Id: <20200803210116.3132633-15-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200803210116.3132633-1-robh@kernel.org> References: <20200803210116.3132633-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(+) -- 2.25.1 diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 8712e595174d..337a3b7766ca 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -935,6 +935,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);