aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2013-10-11 17:05:10 -0400
committerShawn Guo <shawn.guo@freescale.com>2014-05-16 04:19:12 -0400
commit92df232fa6f43a33058a99a9cf670f17d2d64d18 (patch)
tree04b029cd1107fd281456fcee808a0dd63f232976
parentc5754b7462e34a7ac8d990db57b5647fc8783140 (diff)
ENGR00313685-5 of: Add helper for printing an of_phandle_args structure
commit 624cfca534f9b1ffb1326617b4e973a3d5ecff4a upstream. It is sometimes useful for debug to get the contents of an of_phandle_args structure out into the kernel log. Signed-off-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Shawn Guo <shawn.guo@freescale.com> Conflicts: drivers/of/base.c
-rw-r--r--drivers/of/base.c9
-rw-r--r--drivers/of/irq.c6
-rw-r--r--include/linux/of.h1
3 files changed, 13 insertions, 3 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index fad95c811bec..c258df42b002 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1081,6 +1081,15 @@ int of_property_count_strings(struct device_node *np, const char *propname)
1081} 1081}
1082EXPORT_SYMBOL_GPL(of_property_count_strings); 1082EXPORT_SYMBOL_GPL(of_property_count_strings);
1083 1083
1084void of_print_phandle_args(const char *msg, const struct of_phandle_args *args)
1085{
1086 int i;
1087 printk("%s %s", msg, of_node_full_name(args->np));
1088 for (i = 0; i < args->args_count; i++)
1089 printk(i ? ",%08x" : ":%08x", args->args[i]);
1090 printk("\n");
1091}
1092
1084/** 1093/**
1085 * of_parse_phandle - Resolve a phandle property to a device_node pointer 1094 * of_parse_phandle - Resolve a phandle property to a device_node pointer
1086 * @np: Pointer to device node holding phandle property 1095 * @np: Pointer to device node holding phandle property
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 5dc08c865122..1f4ffeb4aaec 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -101,9 +101,9 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
101 u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0; 101 u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
102 int imaplen, match, i; 102 int imaplen, match, i;
103 103
104 pr_debug("of_irq_parse_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n", 104#ifdef DEBUG
105 of_node_full_name(out_irq->np), out_irq->args[0], out_irq->args[1], 105 of_print_phandle_args("of_irq_parse_raw: ", out_irq);
106 out_irq->args_count); 106#endif
107 107
108 ipar = of_node_get(out_irq->np); 108 ipar = of_node_get(out_irq->np);
109 109
diff --git a/include/linux/of.h b/include/linux/of.h
index 429e16801858..668e12322dd4 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -274,6 +274,7 @@ extern int of_n_size_cells(struct device_node *np);
274extern const struct of_device_id *of_match_node( 274extern const struct of_device_id *of_match_node(
275 const struct of_device_id *matches, const struct device_node *node); 275 const struct of_device_id *matches, const struct device_node *node);
276extern int of_modalias_node(struct device_node *node, char *modalias, int len); 276extern int of_modalias_node(struct device_node *node, char *modalias, int len);
277extern void of_print_phandle_args(const char *msg, const struct of_phandle_args *args);
277extern struct device_node *of_parse_phandle(const struct device_node *np, 278extern struct device_node *of_parse_phandle(const struct device_node *np,
278 const char *phandle_name, 279 const char *phandle_name,
279 int index); 280 int index);