diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-07 15:18:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-07 15:18:52 -0500 |
commit | 02550d61f49266930e674286379d3601006b2893 (patch) | |
tree | 2d30df688b7f428908028dd20e83b22bc799dee7 /drivers/of/base.c | |
parent | 2d51daaa615e4724f24e43fa01e705c40551080a (diff) | |
parent | c89810acbcf48c7004e912b2b4b862480b2d00e1 (diff) |
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux-2.6
devicetree/next changes queued for v3.3 merge window
* tag 'devicetree-for-linus-20120104' of git://git.secretlab.ca/git/linux-2.6:
ARM: prom.h: Fix build error by removing unneeded header file
irq: check domain hwirq range for DT translate
dt: add empty of_get_node/of_put_node functions
of/pdt: fix section mismatch warning
i2c-designware: add OF binding support
dt/i2c: Enumerate some of the known trivial i2c devices
dt: reform for_each_property to for_each_property_of_node
ARM/of: allow *machine_desc.dt_compat to be const
of/base: Take NULL string into account for property with multiple strings
OF/device-tree: Add some entries to vendor-prefixes.txt
Fix up trivial add-add conflicts in include/linux/of.h
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r-- | drivers/of/base.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index c6db9ab9046e..133908a6fd8d 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -752,7 +752,7 @@ int of_property_read_string_index(struct device_node *np, const char *propname, | |||
752 | 752 | ||
753 | for (i = 0; total < prop->length; total += l, p += l) { | 753 | for (i = 0; total < prop->length; total += l, p += l) { |
754 | l = strlen(p) + 1; | 754 | l = strlen(p) + 1; |
755 | if ((*p != 0) && (i++ == index)) { | 755 | if (i++ == index) { |
756 | *output = p; | 756 | *output = p; |
757 | return 0; | 757 | return 0; |
758 | } | 758 | } |
@@ -790,11 +790,9 @@ int of_property_count_strings(struct device_node *np, const char *propname) | |||
790 | 790 | ||
791 | p = prop->value; | 791 | p = prop->value; |
792 | 792 | ||
793 | for (i = 0; total < prop->length; total += l, p += l) { | 793 | for (i = 0; total < prop->length; total += l, p += l, i++) |
794 | l = strlen(p) + 1; | 794 | l = strlen(p) + 1; |
795 | if (*p != 0) | 795 | |
796 | i++; | ||
797 | } | ||
798 | return i; | 796 | return i; |
799 | } | 797 | } |
800 | EXPORT_SYMBOL_GPL(of_property_count_strings); | 798 | EXPORT_SYMBOL_GPL(of_property_count_strings); |
@@ -1163,7 +1161,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)) | |||
1163 | if (!of_aliases) | 1161 | if (!of_aliases) |
1164 | return; | 1162 | return; |
1165 | 1163 | ||
1166 | for_each_property(pp, of_aliases->properties) { | 1164 | for_each_property_of_node(of_aliases, pp) { |
1167 | const char *start = pp->name; | 1165 | const char *start = pp->name; |
1168 | const char *end = start + strlen(start); | 1166 | const char *end = start + strlen(start); |
1169 | struct device_node *np; | 1167 | struct device_node *np; |