Lines Matching refs:ce

448 static void __of_changeset_entry_destroy(struct of_changeset_entry *ce)  in __of_changeset_entry_destroy()  argument
450 of_node_put(ce->np); in __of_changeset_entry_destroy()
451 list_del(&ce->node); in __of_changeset_entry_destroy()
452 kfree(ce); in __of_changeset_entry_destroy()
456 static void __of_changeset_entry_dump(struct of_changeset_entry *ce) in __of_changeset_entry_dump() argument
458 switch (ce->action) { in __of_changeset_entry_dump()
462 pr_debug("of/cset<%p> %-15s %s/%s\n", ce, action_names[ce->action], in __of_changeset_entry_dump()
463 ce->np->full_name, ce->prop->name); in __of_changeset_entry_dump()
467 pr_debug("of/cset<%p> %-15s %s\n", ce, action_names[ce->action], in __of_changeset_entry_dump()
468 ce->np->full_name); in __of_changeset_entry_dump()
473 static inline void __of_changeset_entry_dump(struct of_changeset_entry *ce) in __of_changeset_entry_dump() argument
479 static void __of_changeset_entry_invert(struct of_changeset_entry *ce, in __of_changeset_entry_invert() argument
482 memcpy(rce, ce, sizeof(*rce)); in __of_changeset_entry_invert()
484 switch (ce->action) { in __of_changeset_entry_invert()
498 rce->old_prop = ce->prop; in __of_changeset_entry_invert()
499 rce->prop = ce->old_prop; in __of_changeset_entry_invert()
504 static void __of_changeset_entry_notify(struct of_changeset_entry *ce, bool revert) in __of_changeset_entry_notify() argument
511 __of_changeset_entry_invert(ce, &ce_inverted); in __of_changeset_entry_notify()
512 ce = &ce_inverted; in __of_changeset_entry_notify()
515 switch (ce->action) { in __of_changeset_entry_notify()
519 rd.dn = ce->np; in __of_changeset_entry_notify()
520 ret = of_reconfig_notify(ce->action, &rd); in __of_changeset_entry_notify()
525 ret = of_property_notify(ce->action, ce->np, ce->prop, ce->old_prop); in __of_changeset_entry_notify()
529 (int)ce->action); in __of_changeset_entry_notify()
534 pr_err("%s: notifier error @%s\n", __func__, ce->np->full_name); in __of_changeset_entry_notify()
537 static int __of_changeset_entry_apply(struct of_changeset_entry *ce) in __of_changeset_entry_apply() argument
543 __of_changeset_entry_dump(ce); in __of_changeset_entry_apply()
546 switch (ce->action) { in __of_changeset_entry_apply()
548 __of_attach_node(ce->np); in __of_changeset_entry_apply()
551 __of_detach_node(ce->np); in __of_changeset_entry_apply()
555 for (propp = &ce->np->deadprops; *propp; propp = &(*propp)->next) { in __of_changeset_entry_apply()
556 if (*propp == ce->prop) { in __of_changeset_entry_apply()
557 *propp = ce->prop->next; in __of_changeset_entry_apply()
558 ce->prop->next = NULL; in __of_changeset_entry_apply()
563 ret = __of_add_property(ce->np, ce->prop); in __of_changeset_entry_apply()
566 __func__, ce->np->full_name, in __of_changeset_entry_apply()
567 ce->prop->name); in __of_changeset_entry_apply()
572 ret = __of_remove_property(ce->np, ce->prop); in __of_changeset_entry_apply()
575 __func__, ce->np->full_name, in __of_changeset_entry_apply()
576 ce->prop->name); in __of_changeset_entry_apply()
583 for (propp = &ce->np->deadprops; *propp; propp = &(*propp)->next) { in __of_changeset_entry_apply()
584 if (*propp == ce->prop) { in __of_changeset_entry_apply()
585 *propp = ce->prop->next; in __of_changeset_entry_apply()
586 ce->prop->next = NULL; in __of_changeset_entry_apply()
591 ret = __of_update_property(ce->np, ce->prop, &old_prop); in __of_changeset_entry_apply()
594 __func__, ce->np->full_name, in __of_changeset_entry_apply()
595 ce->prop->name); in __of_changeset_entry_apply()
607 switch (ce->action) { in __of_changeset_entry_apply()
609 __of_attach_node_sysfs(ce->np); in __of_changeset_entry_apply()
612 __of_detach_node_sysfs(ce->np); in __of_changeset_entry_apply()
616 __of_add_property_sysfs(ce->np, ce->prop); in __of_changeset_entry_apply()
619 __of_remove_property_sysfs(ce->np, ce->prop); in __of_changeset_entry_apply()
622 __of_update_property_sysfs(ce->np, ce->prop, ce->old_prop); in __of_changeset_entry_apply()
629 static inline int __of_changeset_entry_revert(struct of_changeset_entry *ce) in __of_changeset_entry_revert() argument
633 __of_changeset_entry_invert(ce, &ce_inverted); in __of_changeset_entry_revert()
660 struct of_changeset_entry *ce, *cen; in of_changeset_destroy() local
662 list_for_each_entry_safe_reverse(ce, cen, &ocs->entries, node) in of_changeset_destroy()
663 __of_changeset_entry_destroy(ce); in of_changeset_destroy()
680 struct of_changeset_entry *ce; in of_changeset_apply() local
685 list_for_each_entry(ce, &ocs->entries, node) { in of_changeset_apply()
686 ret = __of_changeset_entry_apply(ce); in of_changeset_apply()
689 list_for_each_entry_continue_reverse(ce, &ocs->entries, node) in of_changeset_apply()
690 __of_changeset_entry_revert(ce); in of_changeset_apply()
698 list_for_each_entry(ce, &ocs->entries, node) in of_changeset_apply()
699 __of_changeset_entry_notify(ce, 0); in of_changeset_apply()
719 struct of_changeset_entry *ce; in of_changeset_revert() local
723 list_for_each_entry_reverse(ce, &ocs->entries, node) { in of_changeset_revert()
724 ret = __of_changeset_entry_revert(ce); in of_changeset_revert()
727 list_for_each_entry_continue(ce, &ocs->entries, node) in of_changeset_revert()
728 __of_changeset_entry_apply(ce); in of_changeset_revert()
736 list_for_each_entry_reverse(ce, &ocs->entries, node) in of_changeset_revert()
737 __of_changeset_entry_notify(ce, 1); in of_changeset_revert()
763 struct of_changeset_entry *ce; in of_changeset_action() local
765 ce = kzalloc(sizeof(*ce), GFP_KERNEL); in of_changeset_action()
766 if (!ce) { in of_changeset_action()
771 ce->action = action; in of_changeset_action()
772 ce->np = of_node_get(np); in of_changeset_action()
773 ce->prop = prop; in of_changeset_action()
776 ce->old_prop = of_find_property(np, prop->name, NULL); in of_changeset_action()
779 list_add_tail(&ce->node, &ocs->entries); in of_changeset_action()