bool of_fdt_device_is_available(const void *blob, unsigned long node)
{
- const char *status = fdt_getprop(blob, node, "status", NULL);
+ const char *status = fdt_stringlist_get(blob, node, "status", 0, NULL);
if (!status)
return true;
* specific compatible values.
*/
static int of_fdt_is_compatible(const void *blob,
- unsigned long node, const char *compat)
+ unsigned long node, const char *compat)
{
const char *cp;
- int cplen;
- unsigned long l, score = 0;
+ int idx = 0, score = 0;
- cp = fdt_getprop(blob, node, "compatible", &cplen);
- if (cp == NULL)
- return 0;
- while (cplen > 0) {
+ while ((cp = fdt_stringlist_get(blob, node, "compatible", idx++, NULL))) {
score++;
if (of_compat_cmp(cp, compat, strlen(compat)) == 0)
return score;
- l = strlen(cp) + 1;
- cp += l;
- cplen -= l;
}
return 0;
const char *name;
unsigned long dt_root = of_get_flat_dt_root();
- name = of_get_flat_dt_prop(dt_root, "model", NULL);
+ name = fdt_stringlist_get(initial_boot_params, dt_root, "model", 0, NULL);
if (!name)
- name = of_get_flat_dt_prop(dt_root, "compatible", NULL);
+ name = fdt_stringlist_get(initial_boot_params, dt_root,
+ "compatible", 0, NULL);
return name;
}
}
if (!best_data) {
const char *prop;
- int size;
+ int idx = 0, size;
pr_err("\n unrecognized device tree list:\n[ ");
- prop = of_get_flat_dt_prop(dt_root, "compatible", &size);
- if (prop) {
- while (size > 0) {
- printk("'%s' ", prop);
- size -= strlen(prop) + 1;
- prop += strlen(prop) + 1;
- }
- }
- printk("]\n\n");
+ while ((prop = fdt_stringlist_get(initial_boot_params, dt_root,
+ "compatible", idx++, &size)))
+ pr_err("'%s' ", prop);
+ pr_err("]\n\n");
return NULL;
}
const void *fdt = initial_boot_params;
fdt_for_each_subnode(node, fdt, 0) {
- const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
+ const char *type = fdt_stringlist_get(fdt, node,
+ "device_type", 0, NULL);
const __be32 *reg;
int i, l;
bool hotpluggable;