From patchwork Wed Nov 4 03:28:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 7548061 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 98734BEEA4 for ; Wed, 4 Nov 2015 03:31:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA0F120462 for ; Wed, 4 Nov 2015 03:30:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DCF1C20450 for ; Wed, 4 Nov 2015 03:30:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753667AbbKDDa6 (ORCPT ); Tue, 3 Nov 2015 22:30:58 -0500 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:39181 "EHLO e23smtp05.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753468AbbKDDa5 (ORCPT ); Tue, 3 Nov 2015 22:30:57 -0500 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Nov 2015 13:30:55 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 4 Nov 2015 13:30:53 +1000 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: weiyang@linux.vnet.ibm.com X-IBM-RcptTo: linux-pci@vger.kernel.org Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 414A72BB0054 for ; Wed, 4 Nov 2015 14:30:53 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tA43Ud6o33554438 for ; Wed, 4 Nov 2015 14:30:47 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tA43UKgq015815 for ; Wed, 4 Nov 2015 14:30:20 +1100 Received: from localhost (richards-mbp.cn.ibm.com [9.123.229.42]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id tA43UJTE014780; Wed, 4 Nov 2015 14:30:20 +1100 From: Wei Yang To: gwshan@linux.vnet.ibm.com, bhelgaas@google.com, mpe@ellerman.id.au, aik@ozlabs.ru Cc: linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, Wei Yang Subject: [PATCH V12 2/9] PCI: Add pcibios_bus_add_device() weak function Date: Wed, 4 Nov 2015 11:28:45 +0800 Message-Id: <1446607732-4166-3-git-send-email-weiyang@linux.vnet.ibm.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1446607732-4166-1-git-send-email-weiyang@linux.vnet.ibm.com> References: <1446607732-4166-1-git-send-email-weiyang@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15110403-0017-0000-0000-00000226BF25 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Add a weak function pcibios_bus_add_device() for arch dependent code could do proper setup. For example, powerpc could setup EEH related resources. Signed-off-by: Wei Yang Acked-by: Bjorn Helgaas --- drivers/pci/bus.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index d3346d2..2b8b756 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -269,6 +269,7 @@ bool pci_bus_clip_resource(struct pci_dev *dev, int idx) void __weak pcibios_resource_survey_bus(struct pci_bus *bus) { } +void __weak pcibios_bus_add_device(struct pci_dev *dev) { } /** * pci_bus_add_device - start driver for a single device * @dev: device to add @@ -279,6 +280,8 @@ void pci_bus_add_device(struct pci_dev *dev) { int retval; + pcibios_bus_add_device(dev); + /* * Can not put in pci_device_add yet because resources * are not assigned yet for some devices.