| 214 | } |
| 215 | |
| 216 | int |
| 217 | of_init_path(const char *dt_path) |
| 218 | { |
| 219 | int ret; |
| 220 | |
| 221 | base_dir = dt_path; |
| 222 | |
| 223 | /* This needs to be singleton initialization */ |
| 224 | DPAAX_HWWARN(alive, "Double-init of device-tree driver!"); |
| 225 | |
| 226 | /* Prepare root node (the remaining fields are set in process_dir()) */ |
| 227 | root_dir.node.node.name[0] = '\0'; |
| 228 | root_dir.node.node.full_name[0] = '\0'; |
| 229 | INIT_LIST_HEAD(&root_dir.node.list); |
| 230 | root_dir.parent = NULL; |
| 231 | |
| 232 | /* Kick things off... */ |
| 233 | ret = process_dir("", &root_dir); |
| 234 | if (ret) { |
| 235 | DPAAX_LOG(ERR, "Unable to parse device tree"); |
| 236 | return ret; |
| 237 | } |
| 238 | |
| 239 | /* Now make a flat, linear list of directories */ |
| 240 | linear_dir(&root_dir); |
| 241 | alive = 1; |
| 242 | return 0; |
| 243 | } |
| 244 | |
| 245 | static void |
| 246 | destroy_dir(struct dt_dir *d) |
no test coverage detected