From: Daniel Axtens <dja@axtens.net>
To: linuxppc-dev@ozlabs.org, benh@kernel.crashing.org, mpe@ellerman.id.au
Cc: Yijing Wang <wangyijing@huawei.com>, Daniel Axtens <dja@axtens.net>
Subject: [RFC PATCH 2/2] powerpc: Migrate pseries to host_bridge_ops, remove pcibios_set_root_bus_speed
Date: Tue, 14 Apr 2015 14:34:01 +1000 [thread overview]
Message-ID: <1428986041-25657-3-git-send-email-dja@axtens.net> (raw)
In-Reply-To: <1428986041-25657-1-git-send-email-dja@axtens.net>
Move the pseries set_root_bus_speed function into a pseries-specific
pci_host_bridge_ops structure.
Only pseries defines set_root_bus_speed. Now that it will be called
through the pci_host_bridge_ops function pointer, both the ppc_md
definition and the function in pci-common.c are unused. Remove them.
Signed-off-by: Daniel Axtens <dja@axtens.net>
---
arch/powerpc/include/asm/machdep.h | 2 --
arch/powerpc/kernel/pci-common.c | 8 --------
arch/powerpc/platforms/pseries/setup.c | 7 +++++--
3 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index f3fea3e..b6912d7 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -125,8 +125,6 @@ struct machdep_calls {
/* Called after scanning the bus, before allocating resources */
void (*pcibios_fixup)(void);
void (*pci_irq_fixup)(struct pci_dev *dev);
- void (*pcibios_set_root_bus_speed)(struct pci_host_bridge
- *bridge);
/* To setup PHBs when using automatic OF platform driver for PCI */
int (*pci_setup_phb)(struct pci_controller *host);
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 326d848..d629ab2 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -761,12 +761,6 @@ int pci_proc_domain(struct pci_bus *bus)
return 1;
}
-void pcibios_set_root_bus_speed(struct pci_host_bridge *bridge)
-{
- if (ppc_md.pcibios_set_root_bus_speed)
- return ppc_md.pcibios_set_root_bus_speed(bridge);
-}
-
static int pci_host_scan_bus(struct pci_host_bridge *host)
{
int mode = PCI_PROBE_NORMAL;
@@ -1635,8 +1629,6 @@ void pcibios_scan_phb(struct pci_controller *hose)
/* Populate generic ops with defaults */
if (!hose->generic_ops.scan_bus)
hose->generic_ops.scan_bus = pci_host_scan_bus;
- if (!hose->generic_ops.set_root_bus_speed)
- hose->generic_ops.set_root_bus_speed = pcibios_set_root_bus_speed;
/* Create an empty bus for the toplevel */
host = pci_scan_host_bridge(hose->parent, hose->global_number,
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 5ee66a1..79380ba 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -461,6 +461,10 @@ static long pseries_little_endian_exceptions(void)
}
#endif
+static struct pci_host_bridge_ops pseries_phb_generic_ops = {
+ .set_root_bus_speed = pseries_set_root_bus_speed,
+};
+
static void __init find_and_init_phbs(void)
{
struct device_node *node;
@@ -475,6 +479,7 @@ static void __init find_and_init_phbs(void)
phb = pcibios_alloc_controller(node);
if (!phb)
continue;
+ phb->generic_ops = pseries_phb_generic_ops;
rtas_setup_phb(phb);
pci_process_bridge_OF_ranges(phb, node, 0);
isa_bridge_find_early(phb);
@@ -544,8 +549,6 @@ static void __init pSeries_setup_arch(void)
ppc_md.enable_pmcs = power4_enable_pmcs;
}
- ppc_md.pcibios_set_root_bus_speed = pseries_set_root_bus_speed;
-
if (firmware_has_feature(FW_FEATURE_SET_MODE)) {
long rc;
--
2.1.4
prev parent reply other threads:[~2015-04-14 4:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-14 4:33 [RFC PATCH 0/2] First steps to using generic controller ops Daniel Axtens
2015-04-14 4:34 ` [RFC PATCH 1/2] powerpc: Add pci_controller.generic_ops and move pci_controller.ops in Daniel Axtens
2015-04-14 4:34 ` Daniel Axtens [this message]
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=1428986041-25657-3-git-send-email-dja@axtens.net \
--to=dja@axtens.net \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=wangyijing@huawei.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).