diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-10-30 19:49:09 +0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-01-01 23:03:25 +0300 |
commit | a4f740cf33f7f6c164bbde3c0cdbcc77b0c4997c (patch) | |
tree | 62d061939000c65d91cf760a51509d388270f4c9 /arch/powerpc/platforms/40x | |
parent | 73930a85cf38d72851305fcf640c07b4c13aa405 (diff) | |
download | linux-a4f740cf33f7f6c164bbde3c0cdbcc77b0c4997c.tar.xz |
of/flattree: Add of_flat_dt_match() helper function
This patch adds of_flat_dt_match() which tests a node for
compatibility with a list of values and converts the relevant powerpc
platform code to use it. This approach simplifies the board support
code a bit.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Diffstat (limited to 'arch/powerpc/platforms/40x')
-rw-r--r-- | arch/powerpc/platforms/40x/ppc40x_simple.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/40x/ppc40x_simple.c b/arch/powerpc/platforms/40x/ppc40x_simple.c index 546bbc229d19..2521d93ef136 100644 --- a/arch/powerpc/platforms/40x/ppc40x_simple.c +++ b/arch/powerpc/platforms/40x/ppc40x_simple.c @@ -50,7 +50,7 @@ machine_device_initcall(ppc40x_simple, ppc40x_device_probe); * Again, if your board needs to do things differently then create a * board.c file for it rather than adding it to this list. */ -static char *board[] __initdata = { +static const char *board[] __initdata = { "amcc,acadia", "amcc,haleakala", "amcc,kilauea", @@ -60,14 +60,9 @@ static char *board[] __initdata = { static int __init ppc40x_probe(void) { - unsigned long root = of_get_flat_dt_root(); - int i = 0; - - for (i = 0; i < ARRAY_SIZE(board); i++) { - if (of_flat_dt_is_compatible(root, board[i])) { - ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC); - return 1; - } + if (of_flat_dt_match(of_get_flat_dt_root(), board)) { + ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC); + return 1; } return 0; |