From: Jiang Liu <liuj97@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Jeremy Fitzhardinge <jeremy@goop.org>
Cc: liuj97@gmail.com, Jiang Liu <jiang.liu@huawei.com>,
Yijing Wang <wangyijing@huawei.com>,
xen-devel@lists.xensource.com,
virtualization@lists.linux-foundation.org,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] PCI: export three functions to support modular host bridge driver
Date: Fri, 21 Jun 2013 01:01:03 +0800 [thread overview]
Message-ID: <1371747665-12768-2-git-send-email-liuj97@gmail.com> (raw)
In-Reply-To: <1371747665-12768-1-git-send-email-liuj97@gmail.com>
From: Jiang Liu <jiang.liu@huawei.com>
The xen-pcifront host bridge driver could be built as a module,
so export pci_create_root_bus(), pci_stop_and_remove_root_bus() and
pci_set_host_bridge_release() to support modular host bridge drivers.
This patch is a preparation for coming xen-pcifront refinement.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: xen-devel@lists.xensource.com
Cc: virtualization@lists.linux-foundation.org
Cc: linux-pci@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/pci/host-bridge.c | 1 +
drivers/pci/probe.c | 1 +
drivers/pci/remove.c | 7 +++++++
include/linux/pci.h | 1 +
4 files changed, 10 insertions(+)
diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c
index a68dc61..6e390a6 100644
--- a/drivers/pci/host-bridge.c
+++ b/drivers/pci/host-bridge.c
@@ -34,6 +34,7 @@ void pci_set_host_bridge_release(struct pci_host_bridge *bridge,
bridge->release_fn = release_fn;
bridge->release_data = release_data;
}
+EXPORT_SYMBOL(pci_set_host_bridge_release);
static bool resource_contains(struct resource *res1, struct resource *res2)
{
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 46ada5c..ed768d8 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1801,6 +1801,7 @@ err_out:
kfree(b);
return NULL;
}
+EXPORT_SYMBOL(pci_create_root_bus);
int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int bus_max)
{
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index 8fc54b7..f328668 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -147,3 +147,10 @@ void pci_remove_root_bus(struct pci_bus *bus)
/* remove the host bridge */
put_device(&host_bridge->dev);
}
+
+void pci_stop_and_remove_root_bus(struct pci_bus *bus)
+{
+ pci_stop_root_bus(bus);
+ pci_remove_root_bus(bus);
+}
+EXPORT_SYMBOL(pci_stop_and_remove_root_bus);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 0fd1f15..f1229c7 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -757,6 +757,7 @@ void pci_remove_bus(struct pci_bus *b);
void pci_stop_and_remove_bus_device(struct pci_dev *dev);
void pci_stop_root_bus(struct pci_bus *bus);
void pci_remove_root_bus(struct pci_bus *bus);
+void pci_stop_and_remove_root_bus(struct pci_bus *bus);
void pci_setup_cardbus(struct pci_bus *bus);
void pci_sort_breadthfirst(void);
#define dev_is_pci(d) ((d)->bus == &pci_bus_type)
--
1.8.1.2
next prev parent reply other threads:[~2013-06-20 17:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 17:01 [PATCH 0/3] deprecate usage of pci_scan_bus_parented() Jiang Liu
2013-06-20 17:01 ` Jiang Liu [this message]
2013-06-20 17:01 ` [PATCH 2/3] PCI, xen-pcifront: use new PCI interfaces to simplify implementation Jiang Liu
2013-06-20 17:01 ` [PATCH 3/3] PCI: mark pci_scan_bus_parented() as __deprecated Jiang Liu
2013-06-20 17:08 ` Greg Kroah-Hartman
2013-06-20 17:14 ` Jiang Liu
2013-06-20 17:31 ` Greg Kroah-Hartman
2013-06-21 18:23 ` [PATCH 0/3] deprecate usage of pci_scan_bus_parented() Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371747665-12768-2-git-send-email-liuj97@gmail.com \
--to=liuj97@gmail.com \
--cc=bhelgaas@google.com \
--cc=jeremy@goop.org \
--cc=jiang.liu@huawei.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=wangyijing@huawei.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).