Lines Matching refs:ce
461 static void __of_changeset_entry_destroy(struct of_changeset_entry *ce)
463 if (ce->action == OF_RECONFIG_ATTACH_NODE &&
464 of_node_check_flag(ce->np, OF_OVERLAY)) {
465 if (kref_read(&ce->np->kobj.kref) > 1) {
467 kref_read(&ce->np->kobj.kref), ce->np);
469 of_node_set_flag(ce->np, OF_OVERLAY_FREE_CSET);
473 of_node_put(ce->np);
474 list_del(&ce->node);
475 kfree(ce);
479 static void __of_changeset_entry_dump(struct of_changeset_entry *ce)
481 switch (ce->action) {
485 pr_debug("cset<%p> %-15s %pOF/%s\n", ce, action_names[ce->action],
486 ce->np, ce->prop->name);
490 pr_debug("cset<%p> %-15s %pOF\n", ce, action_names[ce->action],
491 ce->np);
496 static inline void __of_changeset_entry_dump(struct of_changeset_entry *ce)
502 static void __of_changeset_entry_invert(struct of_changeset_entry *ce,
505 memcpy(rce, ce, sizeof(*rce));
507 switch (ce->action) {
521 rce->old_prop = ce->prop;
522 rce->prop = ce->old_prop;
526 rce->prop = ce->prop;
532 static int __of_changeset_entry_notify(struct of_changeset_entry *ce,
540 __of_changeset_entry_invert(ce, &ce_inverted);
541 ce = &ce_inverted;
544 switch (ce->action) {
548 rd.dn = ce->np;
549 ret = of_reconfig_notify(ce->action, &rd);
554 ret = of_property_notify(ce->action, ce->np, ce->prop, ce->old_prop);
558 (int)ce->action);
563 pr_err("changeset notifier error @%pOF\n", ce->np);
567 static int __of_changeset_entry_apply(struct of_changeset_entry *ce)
573 __of_changeset_entry_dump(ce);
576 switch (ce->action) {
578 __of_attach_node(ce->np);
581 __of_detach_node(ce->np);
585 for (propp = &ce->np->deadprops; *propp; propp = &(*propp)->next) {
586 if (*propp == ce->prop) {
587 *propp = ce->prop->next;
588 ce->prop->next = NULL;
593 ret = __of_add_property(ce->np, ce->prop);
596 ret = __of_remove_property(ce->np, ce->prop);
601 for (propp = &ce->np->deadprops; *propp; propp = &(*propp)->next) {
602 if (*propp == ce->prop) {
603 *propp = ce->prop->next;
604 ce->prop->next = NULL;
609 ret = __of_update_property(ce->np, ce->prop, &old_prop);
618 action_names[ce->action], ce->np, ce->prop->name);
622 switch (ce->action) {
624 __of_attach_node_sysfs(ce->np);
627 __of_detach_node_sysfs(ce->np);
631 __of_add_property_sysfs(ce->np, ce->prop);
634 __of_remove_property_sysfs(ce->np, ce->prop);
637 __of_update_property_sysfs(ce->np, ce->prop, ce->old_prop);
644 static inline int __of_changeset_entry_revert(struct of_changeset_entry *ce)
648 __of_changeset_entry_invert(ce, &ce_inverted);
676 struct of_changeset_entry *ce, *cen;
678 list_for_each_entry_safe_reverse(ce, cen, &ocs->entries, node)
679 __of_changeset_entry_destroy(ce);
695 struct of_changeset_entry *ce;
699 list_for_each_entry(ce, &ocs->entries, node) {
700 ret = __of_changeset_entry_apply(ce);
703 list_for_each_entry_continue_reverse(ce, &ocs->entries,
705 ret_tmp = __of_changeset_entry_revert(ce);
724 struct of_changeset_entry *ce;
731 list_for_each_entry(ce, &ocs->entries, node) {
732 ret_tmp = __of_changeset_entry_notify(ce, 0);
799 struct of_changeset_entry *ce;
803 list_for_each_entry_reverse(ce, &ocs->entries, node) {
804 ret = __of_changeset_entry_revert(ce);
807 list_for_each_entry_continue(ce, &ocs->entries, node) {
808 ret_tmp = __of_changeset_entry_apply(ce);
825 struct of_changeset_entry *ce;
832 list_for_each_entry_reverse(ce, &ocs->entries, node) {
833 ret_tmp = __of_changeset_entry_notify(ce, 1);
900 struct of_changeset_entry *ce;
905 ce = kzalloc(sizeof(*ce), GFP_KERNEL);
906 if (!ce)
910 ce->action = action;
911 ce->np = of_node_get(np);
912 ce->prop = prop;
915 ce->old_prop = of_find_property(np, prop->name, NULL);
918 list_add_tail(&ce->node, &ocs->entries);