aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/base.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-15 12:40:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-15 12:40:05 -0400
commit2ed0e21b30b53d3a94e204196e523e6c8f732b56 (patch)
treede2635426477d86338a9469ce09ba0626052288f /drivers/of/base.c
parent0fa213310cd8fa7a51071cdcf130e26fa56e9549 (diff)
parent9cbc1cb8cd46ce1f7645b9de249b2ce8460129bb (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1244 commits) pkt_sched: Rename PSCHED_US2NS and PSCHED_NS2US ipv4: Fix fib_trie rebalancing Bluetooth: Fix issue with uninitialized nsh.type in DTL-1 driver Bluetooth: Fix Kconfig issue with RFKILL integration PIM-SM: namespace changes ipv4: update ARPD help text net: use a deferred timer in rt_check_expire ieee802154: fix kconfig bool/tristate muckup bonding: initialization rework bonding: use is_zero_ether_addr bonding: network device names are case sensative bonding: elminate bad refcount code bonding: fix style issues bonding: fix destructor bonding: remove bonding read/write semaphore bonding: initialize before registration bonding: bond_create always called with default parameters x_tables: Convert printk to pr_err netfilter: conntrack: optional reliable conntrack event delivery list_nulls: add hlist_nulls_add_head and hlist_nulls_del ...
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r--drivers/of/base.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 391f91c0bf55..69f85c07d17f 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -496,6 +496,30 @@ int of_modalias_node(struct device_node *node, char *modalias, int len)
496EXPORT_SYMBOL_GPL(of_modalias_node); 496EXPORT_SYMBOL_GPL(of_modalias_node);
497 497
498/** 498/**
499 * of_parse_phandle - Resolve a phandle property to a device_node pointer
500 * @np: Pointer to device node holding phandle property
501 * @phandle_name: Name of property holding a phandle value
502 * @index: For properties holding a table of phandles, this is the index into
503 * the table
504 *
505 * Returns the device_node pointer with refcount incremented. Use
506 * of_node_put() on it when done.
507 */
508struct device_node *
509of_parse_phandle(struct device_node *np, const char *phandle_name, int index)
510{
511 const phandle *phandle;
512 int size;
513
514 phandle = of_get_property(np, phandle_name, &size);
515 if ((!phandle) || (size < sizeof(*phandle) * (index + 1)))
516 return NULL;
517
518 return of_find_node_by_phandle(phandle[index]);
519}
520EXPORT_SYMBOL(of_parse_phandle);
521
522/**
499 * of_parse_phandles_with_args - Find a node pointed by phandle in a list 523 * of_parse_phandles_with_args - Find a node pointed by phandle in a list
500 * @np: pointer to a device tree node containing a list 524 * @np: pointer to a device tree node containing a list
501 * @list_name: property name that contains a list 525 * @list_name: property name that contains a list