diff options
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; |