diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 17:53:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 17:53:38 -0400 |
commit | 8181780c163e7111f15619067cfa044172d532e1 (patch) | |
tree | 7eec99ddd1b20e9018edfba5c05a179b317c27fe /drivers/of/address.c | |
parent | 7235dd74a4733d4b3651349b5261d2e06996427d (diff) | |
parent | 99ce39e359fa29e4b609a6a13485e7573eda5dfb (diff) |
Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6
* 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6:
dt: include linux/errno.h in linux/of_address.h
of/address: Add of_find_matching_node_by_address helper
dt: remove extra xsysace platform_driver registration
tty/serial: Add devicetree support for nVidia Tegra serial ports
dt: add empty of_property_read_u32[_array] for non-dt
dt: bindings: move SEC node under new crypto/
dt: add helper function to read u32 arrays
tty/serial: change of_serial to use new of_property_read_u32() api
dt: add 'const' for of_property_read_string parameter **out_string
dt: add helper functions to read u32 and string property values
tty: of_serial: support for 32 bit accesses
dt: document the of_serial bindings
dt/platform: allow device name to be overridden
drivers/amba: create devices from device tree
dt: add of_platform_populate() for creating device from the device tree
dt: Add default match table for bus ids
Diffstat (limited to 'drivers/of/address.c')
-rw-r--r-- | drivers/of/address.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c index b4559c58c09..da1f4b9605d 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c | |||
@@ -577,6 +577,24 @@ int of_address_to_resource(struct device_node *dev, int index, | |||
577 | } | 577 | } |
578 | EXPORT_SYMBOL_GPL(of_address_to_resource); | 578 | EXPORT_SYMBOL_GPL(of_address_to_resource); |
579 | 579 | ||
580 | struct device_node *of_find_matching_node_by_address(struct device_node *from, | ||
581 | const struct of_device_id *matches, | ||
582 | u64 base_address) | ||
583 | { | ||
584 | struct device_node *dn = of_find_matching_node(from, matches); | ||
585 | struct resource res; | ||
586 | |||
587 | while (dn) { | ||
588 | if (of_address_to_resource(dn, 0, &res)) | ||
589 | continue; | ||
590 | if (res.start == base_address) | ||
591 | return dn; | ||
592 | dn = of_find_matching_node(dn, matches); | ||
593 | } | ||
594 | |||
595 | return NULL; | ||
596 | } | ||
597 | |||
580 | 598 | ||
581 | /** | 599 | /** |
582 | * of_iomap - Maps the memory mapped IO for a given device_node | 600 | * of_iomap - Maps the memory mapped IO for a given device_node |