Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of/reconfig: Add debug output for OF_RECONFIG notifiers

Add some additional debug output to cover OF_RECONFIG notifier activity.
At the same time, refactor the changeset debug output to use the same
strings as the notifier debug output.

Signed-off-by: Grant Likely <grant.likely@linaro.org>

+32 -16
+32 -16
drivers/of/dynamic.c
··· 77 77 } 78 78 EXPORT_SYMBOL_GPL(of_reconfig_notifier_unregister); 79 79 80 + #ifdef DEBUG 81 + const char *action_names[] = { 82 + [OF_RECONFIG_ATTACH_NODE] = "ATTACH_NODE", 83 + [OF_RECONFIG_DETACH_NODE] = "DETACH_NODE", 84 + [OF_RECONFIG_ADD_PROPERTY] = "ADD_PROPERTY", 85 + [OF_RECONFIG_REMOVE_PROPERTY] = "REMOVE_PROPERTY", 86 + [OF_RECONFIG_UPDATE_PROPERTY] = "UPDATE_PROPERTY", 87 + }; 88 + #endif 89 + 80 90 int of_reconfig_notify(unsigned long action, void *p) 81 91 { 82 92 int rc; 93 + #ifdef DEBUG 94 + struct device_node *dn = p; 95 + struct of_prop_reconfig *pr = p; 83 96 97 + switch (action) { 98 + case OF_RECONFIG_ATTACH_NODE: 99 + case OF_RECONFIG_DETACH_NODE: 100 + pr_debug("of/notify %-15s %s\n", action_names[action], 101 + dn->full_name); 102 + break; 103 + case OF_RECONFIG_ADD_PROPERTY: 104 + case OF_RECONFIG_REMOVE_PROPERTY: 105 + case OF_RECONFIG_UPDATE_PROPERTY: 106 + pr_debug("of/notify %-15s %s:%s\n", action_names[action], 107 + pr->dn->full_name, pr->prop->name); 108 + break; 109 + 110 + } 111 + #endif 84 112 rc = blocking_notifier_call_chain(&of_reconfig_chain, action, p); 85 113 return notifier_to_errno(rc); 86 114 } ··· 459 431 { 460 432 switch (ce->action) { 461 433 case OF_RECONFIG_ADD_PROPERTY: 462 - pr_debug("%p: %s %s/%s\n", 463 - ce, "ADD_PROPERTY ", ce->np->full_name, 464 - ce->prop->name); 465 - break; 466 434 case OF_RECONFIG_REMOVE_PROPERTY: 467 - pr_debug("%p: %s %s/%s\n", 468 - ce, "REMOVE_PROPERTY", ce->np->full_name, 469 - ce->prop->name); 470 - break; 471 435 case OF_RECONFIG_UPDATE_PROPERTY: 472 - pr_debug("%p: %s %s/%s\n", 473 - ce, "UPDATE_PROPERTY", ce->np->full_name, 474 - ce->prop->name); 436 + pr_debug("of/cset<%p> %-15s %s/%s\n", ce, action_names[ce->action], 437 + ce->np->full_name, ce->prop->name); 475 438 break; 476 439 case OF_RECONFIG_ATTACH_NODE: 477 - pr_debug("%p: %s %s\n", 478 - ce, "ATTACH_NODE ", ce->np->full_name); 479 - break; 480 440 case OF_RECONFIG_DETACH_NODE: 481 - pr_debug("%p: %s %s\n", 482 - ce, "DETACH_NODE ", ce->np->full_name); 441 + pr_debug("of/cset<%p> %-15s %s\n", ce, action_names[ce->action], 442 + ce->np->full_name); 483 443 break; 484 444 } 485 445 }