int fdtdec_find_aliases_for_id(const void *blob, const char *name, enum fdt_compat_id id, int *node_list, int maxcount) { memset(node_list, '\0', sizeof(*node_list) * maxcount); return fdtdec_add_aliases_for_id(blob, name, id, node_list, maxcount); }
/* Sadly there is no error return from this function */ void i2c_init_board(void) { int node_list[TEGRA_I2C_NUM_CONTROLLERS]; const void *blob = gd->fdt_blob; int count; /* First get the normal i2c ports */ count = fdtdec_find_aliases_for_id(blob, "i2c", COMPAT_NVIDIA_TEGRA20_I2C, node_list, TEGRA_I2C_NUM_CONTROLLERS); if (process_nodes(blob, node_list, count, 0)) return; /* Now look for dvc ports */ count = fdtdec_add_aliases_for_id(blob, "i2c", COMPAT_NVIDIA_TEGRA20_DVC, node_list, TEGRA_I2C_NUM_CONTROLLERS); if (process_nodes(blob, node_list, count, 1)) return; }