Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'robherring/for-next' from git://sources.calxeda.com/kernel/linux.git

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

+76 -22
+3
Documentation/devicetree/bindings/vendor-prefixes.txt
··· 14 14 brcm Broadcom Corporation 15 15 cavium Cavium, Inc. 16 16 chrp Common Hardware Reference Platform 17 + cirrus Cirrus Logic, Inc. 17 18 cortina Cortina Systems, Inc. 18 19 dallas Maxim Integrated Products (formerly Dallas Semiconductor) 19 20 denx Denx Software Engineering ··· 43 42 qcom Qualcomm, Inc. 44 43 ramtron Ramtron International 45 44 realtek Realtek Semiconductor Corp. 45 + renesas Renesas Electronics Corporation 46 46 samsung Samsung Semiconductor 47 47 sbs Smart Battery System 48 48 schindler Schindler ··· 54 52 st STMicroelectronics 55 53 stericsson ST-Ericsson 56 54 ti Texas Instruments 55 + toshiba Toshiba Corporation 57 56 via VIA Technologies, Inc. 58 57 wlf Wolfson Microelectronics 59 58 wm Wondermedia Technologies, Inc.
+73 -22
drivers/of/base.c
··· 147 147 EXPORT_SYMBOL(of_node_put); 148 148 #endif /* CONFIG_OF_DYNAMIC */ 149 149 150 - struct property *of_find_property(const struct device_node *np, 151 - const char *name, 152 - int *lenp) 150 + static struct property *__of_find_property(const struct device_node *np, 151 + const char *name, int *lenp) 153 152 { 154 153 struct property *pp; 155 154 156 155 if (!np) 157 156 return NULL; 158 157 159 - read_lock(&devtree_lock); 160 158 for (pp = np->properties; pp; pp = pp->next) { 161 159 if (of_prop_cmp(pp->name, name) == 0) { 162 160 if (lenp) ··· 162 164 break; 163 165 } 164 166 } 167 + 168 + return pp; 169 + } 170 + 171 + struct property *of_find_property(const struct device_node *np, 172 + const char *name, 173 + int *lenp) 174 + { 175 + struct property *pp; 176 + 177 + read_lock(&devtree_lock); 178 + pp = __of_find_property(np, name, lenp); 165 179 read_unlock(&devtree_lock); 166 180 167 181 return pp; ··· 207 197 * Find a property with a given name for a given node 208 198 * and return the value. 209 199 */ 200 + static const void *__of_get_property(const struct device_node *np, 201 + const char *name, int *lenp) 202 + { 203 + struct property *pp = __of_find_property(np, name, lenp); 204 + 205 + return pp ? pp->value : NULL; 206 + } 207 + 208 + /* 209 + * Find a property with a given name for a given node 210 + * and return the value. 211 + */ 210 212 const void *of_get_property(const struct device_node *np, const char *name, 211 - int *lenp) 213 + int *lenp) 212 214 { 213 215 struct property *pp = of_find_property(np, name, lenp); 214 216 ··· 231 209 /** Checks if the given "compat" string matches one of the strings in 232 210 * the device's "compatible" property 233 211 */ 234 - int of_device_is_compatible(const struct device_node *device, 235 - const char *compat) 212 + static int __of_device_is_compatible(const struct device_node *device, 213 + const char *compat) 236 214 { 237 215 const char* cp; 238 216 int cplen, l; 239 217 240 - cp = of_get_property(device, "compatible", &cplen); 218 + cp = __of_get_property(device, "compatible", &cplen); 241 219 if (cp == NULL) 242 220 return 0; 243 221 while (cplen > 0) { ··· 249 227 } 250 228 251 229 return 0; 230 + } 231 + 232 + /** Checks if the given "compat" string matches one of the strings in 233 + * the device's "compatible" property 234 + */ 235 + int of_device_is_compatible(const struct device_node *device, 236 + const char *compat) 237 + { 238 + int res; 239 + 240 + read_lock(&devtree_lock); 241 + res = __of_device_is_compatible(device, compat); 242 + read_unlock(&devtree_lock); 243 + return res; 252 244 } 253 245 EXPORT_SYMBOL(of_device_is_compatible); 254 246 ··· 537 501 if (type 538 502 && !(np->type && (of_node_cmp(np->type, type) == 0))) 539 503 continue; 540 - if (of_device_is_compatible(np, compatible) && of_node_get(np)) 504 + if (__of_device_is_compatible(np, compatible) && 505 + of_node_get(np)) 541 506 break; 542 507 } 543 508 of_node_put(from); ··· 582 545 } 583 546 EXPORT_SYMBOL(of_find_node_with_property); 584 547 585 - /** 586 - * of_match_node - Tell if an device_node has a matching of_match structure 587 - * @matches: array of of device match structures to search in 588 - * @node: the of device structure to match against 589 - * 590 - * Low level utility function used by device matching. 591 - */ 592 - const struct of_device_id *of_match_node(const struct of_device_id *matches, 593 - const struct device_node *node) 548 + static 549 + const struct of_device_id *__of_match_node(const struct of_device_id *matches, 550 + const struct device_node *node) 594 551 { 595 552 if (!matches) 596 553 return NULL; ··· 598 567 match &= node->type 599 568 && !strcmp(matches->type, node->type); 600 569 if (matches->compatible[0]) 601 - match &= of_device_is_compatible(node, 602 - matches->compatible); 570 + match &= __of_device_is_compatible(node, 571 + matches->compatible); 603 572 if (match) 604 573 return matches; 605 574 matches++; 606 575 } 607 576 return NULL; 577 + } 578 + 579 + /** 580 + * of_match_node - Tell if an device_node has a matching of_match structure 581 + * @matches: array of of device match structures to search in 582 + * @node: the of device structure to match against 583 + * 584 + * Low level utility function used by device matching. 585 + */ 586 + const struct of_device_id *of_match_node(const struct of_device_id *matches, 587 + const struct device_node *node) 588 + { 589 + const struct of_device_id *match; 590 + 591 + read_lock(&devtree_lock); 592 + match = __of_match_node(matches, node); 593 + read_unlock(&devtree_lock); 594 + return match; 608 595 } 609 596 EXPORT_SYMBOL(of_match_node); 610 597 ··· 644 595 const struct of_device_id **match) 645 596 { 646 597 struct device_node *np; 598 + const struct of_device_id *m; 647 599 648 600 if (match) 649 601 *match = NULL; ··· 652 602 read_lock(&devtree_lock); 653 603 np = from ? from->allnext : of_allnodes; 654 604 for (; np; np = np->allnext) { 655 - if (of_match_node(matches, np) && of_node_get(np)) { 605 + m = __of_match_node(matches, np); 606 + if (m && of_node_get(np)) { 656 607 if (match) 657 - *match = matches; 608 + *match = m; 658 609 break; 659 610 } 660 611 }