[PATCH v2 36/45] dm: core: Split ofnode_path_root() into two functions