Lines Matching refs:ce

519 static void __of_changeset_entry_destroy(struct of_changeset_entry *ce)  in __of_changeset_entry_destroy()  argument
521 if (ce->action == OF_RECONFIG_ATTACH_NODE && in __of_changeset_entry_destroy()
522 of_node_check_flag(ce->np, OF_OVERLAY)) { in __of_changeset_entry_destroy()
523 if (kref_read(&ce->np->kobj.kref) > 1) { in __of_changeset_entry_destroy()
525 kref_read(&ce->np->kobj.kref), ce->np); in __of_changeset_entry_destroy()
527 of_node_set_flag(ce->np, OF_OVERLAY_FREE_CSET); in __of_changeset_entry_destroy()
531 of_node_put(ce->np); in __of_changeset_entry_destroy()
532 list_del(&ce->node); in __of_changeset_entry_destroy()
533 kfree(ce); in __of_changeset_entry_destroy()
536 static void __of_changeset_entry_invert(struct of_changeset_entry *ce, in __of_changeset_entry_invert() argument
539 memcpy(rce, ce, sizeof(*rce)); in __of_changeset_entry_invert()
541 switch (ce->action) { in __of_changeset_entry_invert()
555 rce->old_prop = ce->prop; in __of_changeset_entry_invert()
556 rce->prop = ce->old_prop; in __of_changeset_entry_invert()
560 rce->prop = ce->prop; in __of_changeset_entry_invert()
566 static int __of_changeset_entry_notify(struct of_changeset_entry *ce, in __of_changeset_entry_notify() argument
574 __of_changeset_entry_invert(ce, &ce_inverted); in __of_changeset_entry_notify()
575 ce = &ce_inverted; in __of_changeset_entry_notify()
578 switch (ce->action) { in __of_changeset_entry_notify()
582 rd.dn = ce->np; in __of_changeset_entry_notify()
583 ret = of_reconfig_notify(ce->action, &rd); in __of_changeset_entry_notify()
588 ret = of_property_notify(ce->action, ce->np, ce->prop, ce->old_prop); in __of_changeset_entry_notify()
592 (int)ce->action); in __of_changeset_entry_notify()
597 pr_err("changeset notifier error @%pOF\n", ce->np); in __of_changeset_entry_notify()
601 static int __of_changeset_entry_apply(struct of_changeset_entry *ce) in __of_changeset_entry_apply() argument
605 of_changeset_action_debug("apply: ", ce->action, ce->np, ce->prop); in __of_changeset_entry_apply()
607 switch (ce->action) { in __of_changeset_entry_apply()
609 __of_attach_node(ce->np); in __of_changeset_entry_apply()
612 __of_detach_node(ce->np); in __of_changeset_entry_apply()
615 ret = __of_add_property(ce->np, ce->prop); in __of_changeset_entry_apply()
618 ret = __of_remove_property(ce->np, ce->prop); in __of_changeset_entry_apply()
622 ret = __of_update_property(ce->np, ce->prop, &ce->old_prop); in __of_changeset_entry_apply()
629 of_changeset_action_err("apply failed: ", ce->action, ce->np, ce->prop); in __of_changeset_entry_apply()
636 static inline int __of_changeset_entry_revert(struct of_changeset_entry *ce) in __of_changeset_entry_revert() argument
640 __of_changeset_entry_invert(ce, &ce_inverted); in __of_changeset_entry_revert()
668 struct of_changeset_entry *ce, *cen; in of_changeset_destroy() local
670 list_for_each_entry_safe_reverse(ce, cen, &ocs->entries, node) in of_changeset_destroy()
671 __of_changeset_entry_destroy(ce); in of_changeset_destroy()
687 struct of_changeset_entry *ce; in __of_changeset_apply_entries() local
691 list_for_each_entry(ce, &ocs->entries, node) { in __of_changeset_apply_entries()
692 ret = __of_changeset_entry_apply(ce); in __of_changeset_apply_entries()
695 list_for_each_entry_continue_reverse(ce, &ocs->entries, in __of_changeset_apply_entries()
697 ret_tmp = __of_changeset_entry_revert(ce); in __of_changeset_apply_entries()
716 struct of_changeset_entry *ce; in __of_changeset_apply_notify() local
723 list_for_each_entry(ce, &ocs->entries, node) { in __of_changeset_apply_notify()
724 ret_tmp = __of_changeset_entry_notify(ce, 0); in __of_changeset_apply_notify()
791 struct of_changeset_entry *ce; in __of_changeset_revert_entries() local
795 list_for_each_entry_reverse(ce, &ocs->entries, node) { in __of_changeset_revert_entries()
796 ret = __of_changeset_entry_revert(ce); in __of_changeset_revert_entries()
799 list_for_each_entry_continue(ce, &ocs->entries, node) { in __of_changeset_revert_entries()
800 ret_tmp = __of_changeset_entry_apply(ce); in __of_changeset_revert_entries()
817 struct of_changeset_entry *ce; in __of_changeset_revert_notify() local
824 list_for_each_entry_reverse(ce, &ocs->entries, node) { in __of_changeset_revert_notify()
825 ret_tmp = __of_changeset_entry_notify(ce, 1); in __of_changeset_revert_notify()
892 struct of_changeset_entry *ce; in of_changeset_action() local
897 ce = kzalloc(sizeof(*ce), GFP_KERNEL); in of_changeset_action()
898 if (!ce) in of_changeset_action()
902 ce->action = action; in of_changeset_action()
903 ce->np = of_node_get(np); in of_changeset_action()
904 ce->prop = prop; in of_changeset_action()
907 list_add_tail(&ce->node, &ocs->entries); in of_changeset_action()