Lines Matching refs:ce
435 static void __of_changeset_entry_destroy(struct of_changeset_entry *ce) in __of_changeset_entry_destroy() argument
437 of_node_put(ce->np); in __of_changeset_entry_destroy()
438 list_del(&ce->node); in __of_changeset_entry_destroy()
439 kfree(ce); in __of_changeset_entry_destroy()
443 static void __of_changeset_entry_dump(struct of_changeset_entry *ce) in __of_changeset_entry_dump() argument
445 switch (ce->action) { in __of_changeset_entry_dump()
449 pr_debug("cset<%p> %-15s %pOF/%s\n", ce, action_names[ce->action], in __of_changeset_entry_dump()
450 ce->np, ce->prop->name); in __of_changeset_entry_dump()
454 pr_debug("cset<%p> %-15s %pOF\n", ce, action_names[ce->action], in __of_changeset_entry_dump()
455 ce->np); in __of_changeset_entry_dump()
460 static inline void __of_changeset_entry_dump(struct of_changeset_entry *ce) in __of_changeset_entry_dump() argument
466 static void __of_changeset_entry_invert(struct of_changeset_entry *ce, in __of_changeset_entry_invert() argument
469 memcpy(rce, ce, sizeof(*rce)); in __of_changeset_entry_invert()
471 switch (ce->action) { in __of_changeset_entry_invert()
485 rce->old_prop = ce->prop; in __of_changeset_entry_invert()
486 rce->prop = ce->old_prop; in __of_changeset_entry_invert()
490 rce->prop = ce->prop; in __of_changeset_entry_invert()
496 static int __of_changeset_entry_notify(struct of_changeset_entry *ce, in __of_changeset_entry_notify() argument
504 __of_changeset_entry_invert(ce, &ce_inverted); in __of_changeset_entry_notify()
505 ce = &ce_inverted; in __of_changeset_entry_notify()
508 switch (ce->action) { in __of_changeset_entry_notify()
512 rd.dn = ce->np; in __of_changeset_entry_notify()
513 ret = of_reconfig_notify(ce->action, &rd); in __of_changeset_entry_notify()
518 ret = of_property_notify(ce->action, ce->np, ce->prop, ce->old_prop); in __of_changeset_entry_notify()
522 (int)ce->action); in __of_changeset_entry_notify()
527 pr_err("changeset notifier error @%pOF\n", ce->np); in __of_changeset_entry_notify()
531 static int __of_changeset_entry_apply(struct of_changeset_entry *ce) in __of_changeset_entry_apply() argument
537 __of_changeset_entry_dump(ce); in __of_changeset_entry_apply()
540 switch (ce->action) { in __of_changeset_entry_apply()
542 __of_attach_node(ce->np); in __of_changeset_entry_apply()
545 __of_detach_node(ce->np); in __of_changeset_entry_apply()
549 for (propp = &ce->np->deadprops; *propp; propp = &(*propp)->next) { in __of_changeset_entry_apply()
550 if (*propp == ce->prop) { in __of_changeset_entry_apply()
551 *propp = ce->prop->next; in __of_changeset_entry_apply()
552 ce->prop->next = NULL; in __of_changeset_entry_apply()
557 ret = __of_add_property(ce->np, ce->prop); in __of_changeset_entry_apply()
560 ce->np, in __of_changeset_entry_apply()
561 ce->prop->name); in __of_changeset_entry_apply()
566 ret = __of_remove_property(ce->np, ce->prop); in __of_changeset_entry_apply()
569 ce->np, in __of_changeset_entry_apply()
570 ce->prop->name); in __of_changeset_entry_apply()
577 for (propp = &ce->np->deadprops; *propp; propp = &(*propp)->next) { in __of_changeset_entry_apply()
578 if (*propp == ce->prop) { in __of_changeset_entry_apply()
579 *propp = ce->prop->next; in __of_changeset_entry_apply()
580 ce->prop->next = NULL; in __of_changeset_entry_apply()
585 ret = __of_update_property(ce->np, ce->prop, &old_prop); in __of_changeset_entry_apply()
588 ce->np, in __of_changeset_entry_apply()
589 ce->prop->name); in __of_changeset_entry_apply()
601 switch (ce->action) { in __of_changeset_entry_apply()
603 __of_attach_node_sysfs(ce->np); in __of_changeset_entry_apply()
606 __of_detach_node_sysfs(ce->np); in __of_changeset_entry_apply()
610 __of_add_property_sysfs(ce->np, ce->prop); in __of_changeset_entry_apply()
613 __of_remove_property_sysfs(ce->np, ce->prop); in __of_changeset_entry_apply()
616 __of_update_property_sysfs(ce->np, ce->prop, ce->old_prop); in __of_changeset_entry_apply()
623 static inline int __of_changeset_entry_revert(struct of_changeset_entry *ce) in __of_changeset_entry_revert() argument
627 __of_changeset_entry_invert(ce, &ce_inverted); in __of_changeset_entry_revert()
655 struct of_changeset_entry *ce, *cen; in of_changeset_destroy() local
657 list_for_each_entry_safe_reverse(ce, cen, &ocs->entries, node) in of_changeset_destroy()
658 __of_changeset_entry_destroy(ce); in of_changeset_destroy()
674 struct of_changeset_entry *ce; in __of_changeset_apply_entries() local
678 list_for_each_entry(ce, &ocs->entries, node) { in __of_changeset_apply_entries()
679 ret = __of_changeset_entry_apply(ce); in __of_changeset_apply_entries()
682 list_for_each_entry_continue_reverse(ce, &ocs->entries, in __of_changeset_apply_entries()
684 ret_tmp = __of_changeset_entry_revert(ce); in __of_changeset_apply_entries()
703 struct of_changeset_entry *ce; in __of_changeset_apply_notify() local
710 list_for_each_entry(ce, &ocs->entries, node) { in __of_changeset_apply_notify()
711 ret_tmp = __of_changeset_entry_notify(ce, 0); in __of_changeset_apply_notify()
777 struct of_changeset_entry *ce; in __of_changeset_revert_entries() local
781 list_for_each_entry_reverse(ce, &ocs->entries, node) { in __of_changeset_revert_entries()
782 ret = __of_changeset_entry_revert(ce); in __of_changeset_revert_entries()
785 list_for_each_entry_continue(ce, &ocs->entries, node) { in __of_changeset_revert_entries()
786 ret_tmp = __of_changeset_entry_apply(ce); in __of_changeset_revert_entries()
803 struct of_changeset_entry *ce; in __of_changeset_revert_notify() local
810 list_for_each_entry_reverse(ce, &ocs->entries, node) { in __of_changeset_revert_notify()
811 ret_tmp = __of_changeset_entry_notify(ce, 1); in __of_changeset_revert_notify()
876 struct of_changeset_entry *ce; in of_changeset_action() local
878 ce = kzalloc(sizeof(*ce), GFP_KERNEL); in of_changeset_action()
879 if (!ce) in of_changeset_action()
883 ce->action = action; in of_changeset_action()
884 ce->np = of_node_get(np); in of_changeset_action()
885 ce->prop = prop; in of_changeset_action()
888 ce->old_prop = of_find_property(np, prop->name, NULL); in of_changeset_action()
891 list_add_tail(&ce->node, &ocs->entries); in of_changeset_action()