summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/52xx/lite5200.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-10-30 11:49:09 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-01-01 13:03:25 -0700
commita4f740cf33f7f6c164bbde3c0cdbcc77b0c4997c (patch)
tree62d061939000c65d91cf760a51509d388270f4c9 /arch/powerpc/platforms/52xx/lite5200.c
parent73930a85cf38d72851305fcf640c07b4c13aa405 (diff)
downloadtalos-obmc-linux-a4f740cf33f7f6c164bbde3c0cdbcc77b0c4997c.tar.gz
talos-obmc-linux-a4f740cf33f7f6c164bbde3c0cdbcc77b0c4997c.zip
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/52xx/lite5200.c')
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index de55bc0584b5..01ffa64d2aa7 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -172,20 +172,18 @@ static void __init lite5200_setup_arch(void)
mpc52xx_setup_pci();
}
+static const char *board[] __initdata = {
+ "fsl,lite5200",
+ "fsl,lite5200b",
+ NULL,
+};
+
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
static int __init lite5200_probe(void)
{
- unsigned long node = of_get_flat_dt_root();
- const char *model = of_get_flat_dt_prop(node, "model", NULL);
-
- if (!of_flat_dt_is_compatible(node, "fsl,lite5200") &&
- !of_flat_dt_is_compatible(node, "fsl,lite5200b"))
- return 0;
- pr_debug("%s board found\n", model ? model : "unknown");
-
- return 1;
+ return of_flat_dt_match(of_get_flat_dt_root(), board);
}
define_machine(lite5200) {
OpenPOWER on IntegriCloud