Lines Matching refs:ce
522 static void __of_changeset_entry_destroy(struct of_changeset_entry *ce) in __of_changeset_entry_destroy() argument
524 if (ce->action == OF_RECONFIG_ATTACH_NODE && in __of_changeset_entry_destroy()
525 of_node_check_flag(ce->np, OF_OVERLAY)) { in __of_changeset_entry_destroy()
526 if (kref_read(&ce->np->kobj.kref) > 1) { in __of_changeset_entry_destroy()
528 kref_read(&ce->np->kobj.kref), ce->np); in __of_changeset_entry_destroy()
530 of_node_set_flag(ce->np, OF_OVERLAY_FREE_CSET); in __of_changeset_entry_destroy()
534 of_node_put(ce->np); in __of_changeset_entry_destroy()
535 list_del(&ce->node); in __of_changeset_entry_destroy()
536 kfree(ce); in __of_changeset_entry_destroy()
539 static void __of_changeset_entry_invert(const struct of_changeset_entry *ce, in __of_changeset_entry_invert() argument
542 memcpy(rce, ce, sizeof(*rce)); in __of_changeset_entry_invert()
544 switch (ce->action) { in __of_changeset_entry_invert()
558 rce->old_prop = ce->prop; in __of_changeset_entry_invert()
559 rce->prop = ce->old_prop; in __of_changeset_entry_invert()
563 rce->prop = ce->prop; in __of_changeset_entry_invert()
569 static int __of_changeset_entry_notify(struct of_changeset_entry *ce, in __of_changeset_entry_notify() argument
577 __of_changeset_entry_invert(ce, &ce_inverted); in __of_changeset_entry_notify()
578 ce = &ce_inverted; in __of_changeset_entry_notify()
581 switch (ce->action) { in __of_changeset_entry_notify()
585 rd.dn = ce->np; in __of_changeset_entry_notify()
586 ret = of_reconfig_notify(ce->action, &rd); in __of_changeset_entry_notify()
591 ret = of_property_notify(ce->action, ce->np, ce->prop, ce->old_prop); in __of_changeset_entry_notify()
595 (int)ce->action); in __of_changeset_entry_notify()
600 pr_err("changeset notifier error @%pOF\n", ce->np); in __of_changeset_entry_notify()
604 static int __of_changeset_entry_apply(struct of_changeset_entry *ce) in __of_changeset_entry_apply() argument
608 of_changeset_action_debug("apply: ", ce->action, ce->np, ce->prop); in __of_changeset_entry_apply()
610 switch (ce->action) { in __of_changeset_entry_apply()
612 __of_attach_node(ce->np); in __of_changeset_entry_apply()
615 __of_detach_node(ce->np); in __of_changeset_entry_apply()
618 ret = __of_add_property(ce->np, ce->prop); in __of_changeset_entry_apply()
621 ret = __of_remove_property(ce->np, ce->prop); in __of_changeset_entry_apply()
625 ret = __of_update_property(ce->np, ce->prop, &ce->old_prop); in __of_changeset_entry_apply()
632 of_changeset_action_err("apply failed: ", ce->action, ce->np, ce->prop); in __of_changeset_entry_apply()
639 static inline int __of_changeset_entry_revert(const struct of_changeset_entry *ce) in __of_changeset_entry_revert() argument
643 __of_changeset_entry_invert(ce, &ce_inverted); in __of_changeset_entry_revert()
671 struct of_changeset_entry *ce, *cen; in of_changeset_destroy() local
684 list_for_each_entry_safe_reverse(ce, cen, &ocs->entries, node) in of_changeset_destroy()
685 __of_changeset_entry_destroy(ce); in of_changeset_destroy()
701 struct of_changeset_entry *ce; in __of_changeset_apply_entries() local
705 list_for_each_entry(ce, &ocs->entries, node) { in __of_changeset_apply_entries()
706 ret = __of_changeset_entry_apply(ce); in __of_changeset_apply_entries()
709 list_for_each_entry_continue_reverse(ce, &ocs->entries, in __of_changeset_apply_entries()
711 ret_tmp = __of_changeset_entry_revert(ce); in __of_changeset_apply_entries()
730 struct of_changeset_entry *ce; in __of_changeset_apply_notify() local
737 list_for_each_entry(ce, &ocs->entries, node) { in __of_changeset_apply_notify()
738 ret_tmp = __of_changeset_entry_notify(ce, 0); in __of_changeset_apply_notify()
805 struct of_changeset_entry *ce; in __of_changeset_revert_entries() local
809 list_for_each_entry_reverse(ce, &ocs->entries, node) { in __of_changeset_revert_entries()
810 ret = __of_changeset_entry_revert(ce); in __of_changeset_revert_entries()
813 list_for_each_entry_continue(ce, &ocs->entries, node) { in __of_changeset_revert_entries()
814 ret_tmp = __of_changeset_entry_apply(ce); in __of_changeset_revert_entries()
831 struct of_changeset_entry *ce; in __of_changeset_revert_notify() local
838 list_for_each_entry_reverse(ce, &ocs->entries, node) { in __of_changeset_revert_notify()
839 ret_tmp = __of_changeset_entry_notify(ce, 1); in __of_changeset_revert_notify()
906 struct of_changeset_entry *ce; in of_changeset_action() local
911 ce = kzalloc(sizeof(*ce), GFP_KERNEL); in of_changeset_action()
912 if (!ce) in of_changeset_action()
916 ce->action = action; in of_changeset_action()
917 ce->np = of_node_get(np); in of_changeset_action()
918 ce->prop = prop; in of_changeset_action()
921 list_add_tail(&ce->node, &ocs->entries); in of_changeset_action()