Lines Matching refs:tp

70 set_create_error(topo_hdl_t *thp, ttree_t *tp, int err)  in set_create_error()  argument
72 if (tp != NULL) in set_create_error()
73 topo_tree_destroy(tp); in set_create_error()
84 ttree_t *tp; in topo_tree_create() local
87 if ((tp = topo_mod_zalloc(mod, sizeof (ttree_t))) == NULL) in topo_tree_create()
90 tp->tt_mod = mod; in topo_tree_create()
92 if ((tp->tt_scheme = topo_mod_strdup(mod, scheme)) == NULL) in topo_tree_create()
93 return (set_create_error(thp, tp, ETOPO_NOMEM)); in topo_tree_create()
98 if ((tp->tt_walk = topo_mod_zalloc(mod, sizeof (topo_walk_t))) == NULL) in topo_tree_create()
99 return (set_create_error(thp, tp, ETOPO_NOMEM)); in topo_tree_create()
105 return (set_create_error(thp, tp, 0)); /* th_errno set */ in topo_tree_create()
108 rp->tn_name = tp->tt_scheme; in topo_tree_create()
115 tp->tt_walk->tw_root = rp; in topo_tree_create()
116 tp->tt_walk->tw_thp = thp; in topo_tree_create()
120 tp->tt_root = rp; in topo_tree_create()
122 return (tp); in topo_tree_create()
126 topo_tree_destroy(ttree_t *tp) in topo_tree_destroy() argument
130 if (tp == NULL) in topo_tree_destroy()
133 mod = tp->tt_mod; in topo_tree_destroy()
134 if (tp->tt_walk != NULL) in topo_tree_destroy()
135 topo_mod_free(mod, tp->tt_walk, sizeof (topo_walk_t)); in topo_tree_destroy()
137 if (tp->tt_root != NULL) { in topo_tree_destroy()
138 assert(tp->tt_root->tn_refs == 1); in topo_tree_destroy()
139 topo_node_rele(tp->tt_root); in topo_tree_destroy()
146 if (tp->tt_scheme != NULL) in topo_tree_destroy()
147 topo_mod_strfree(mod, tp->tt_scheme); in topo_tree_destroy()
149 topo_mod_free(mod, tp, sizeof (ttree_t)); in topo_tree_destroy()
153 topo_tree_enum(topo_hdl_t *thp, ttree_t *tp) in topo_tree_enum() argument
173 if (topo_file_load(tp->tt_root->tn_enum, tp->tt_root, in topo_tree_enum()
174 pp, tp->tt_scheme, 0) < 0) { in topo_tree_enum()
180 if (topo_file_load(tp->tt_root->tn_enum, tp->tt_root, in topo_tree_enum()
181 pp, tp->tt_scheme, 0) < 0) { in topo_tree_enum()
182 if (topo_file_load(tp->tt_root->tn_enum, tp->tt_root, in topo_tree_enum()
183 thp->th_machine, tp->tt_scheme, 0) < 0) { in topo_tree_enum()
185 if ((rv = topo_file_load(tp->tt_root->tn_enum, in topo_tree_enum()
186 tp->tt_root, NULL, tp->tt_scheme, 0)) < 0) { in topo_tree_enum()
189 "FMRI set\n", tp->tt_scheme); in topo_tree_enum()
205 ttree_t *tp; in topo_tree_enum_all() local
207 for (tp = topo_list_next(&thp->th_trees); tp != NULL; in topo_tree_enum_all()
208 tp = topo_list_next(tp)) { in topo_tree_enum_all()
209 err |= topo_tree_enum(thp, tp); in topo_tree_enum_all()