遍历节点设备属性
内核原型为__of_find_property(dev_node, "compatible", len);
static struct property *BAD_of_find_property(const struct device_node *np,
const char *name, int *lenp)
{
struct property *pp;
if (!np)
return NULL;
for (pp = np->properties; pp; pp = pp->next)
{
printk(KERN_EMERG "property:%s\n", pp->name);
if (strncmp(pp->name, name, strlen(lenp)) == 0)
{
printk(KERN_EMERG "OK!\n");
}
}
return pp;
}
struct property *prop;
prop = BAD_of_find_property(dev_node, "compatible", len);
获取属性值:const char *cp = of_prop_next_string(prop,NULL);