Lines Matching refs:tree
322 struct hdac_widget_tree *tree = codec->widgets; in widget_tree_free() local
325 if (!tree) in widget_tree_free()
327 free_widget_node(tree->afg, &widget_afg_group); in widget_tree_free()
328 if (tree->nodes) { in widget_tree_free()
329 for (p = tree->nodes; *p; p++) in widget_tree_free()
331 kfree(tree->nodes); in widget_tree_free()
333 kobject_put(tree->root); in widget_tree_free()
334 kfree(tree); in widget_tree_free()
363 struct hdac_widget_tree *tree; in widget_tree_create() local
367 tree = codec->widgets = kzalloc(sizeof(*tree), GFP_KERNEL); in widget_tree_create()
368 if (!tree) in widget_tree_create()
371 tree->root = kobject_create_and_add("widgets", &codec->dev.kobj); in widget_tree_create()
372 if (!tree->root) in widget_tree_create()
375 tree->nodes = kcalloc(codec->num_nodes + 1, sizeof(*tree->nodes), in widget_tree_create()
377 if (!tree->nodes) in widget_tree_create()
381 err = add_widget_node(tree->root, nid, &widget_node_group, in widget_tree_create()
382 &tree->nodes[i]); in widget_tree_create()
388 err = add_widget_node(tree->root, codec->afg, in widget_tree_create()
389 &widget_afg_group, &tree->afg); in widget_tree_create()
394 kobject_uevent(tree->root, KOBJ_CHANGE); in widget_tree_create()
425 struct hdac_widget_tree *tree; in hda_widget_sysfs_reinit() local
433 tree = kmemdup(codec->widgets, sizeof(*tree), GFP_KERNEL); in hda_widget_sysfs_reinit()
434 if (!tree) in hda_widget_sysfs_reinit()
437 tree->nodes = kcalloc(num_nodes + 1, sizeof(*tree->nodes), GFP_KERNEL); in hda_widget_sysfs_reinit()
438 if (!tree->nodes) { in hda_widget_sysfs_reinit()
439 kfree(tree); in hda_widget_sysfs_reinit()
453 add_widget_node(tree->root, nid, &widget_node_group, in hda_widget_sysfs_reinit()
454 &tree->nodes[i]); in hda_widget_sysfs_reinit()
456 tree->nodes[i] = in hda_widget_sysfs_reinit()
463 codec->widgets = tree; in hda_widget_sysfs_reinit()
465 kobject_uevent(tree->root, KOBJ_CHANGE); in hda_widget_sysfs_reinit()