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

of: use pr_fmt prefix for all console printing

Clean-up all the DT printk functions to use common pr_fmt prefix.

Some print statements such as kmalloc errors were redundant, so just
drop those.

Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Reviewed-by: Frank Rowand <frank.rowand@am.sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>

+124 -121
+25 -24
drivers/of/address.c
··· 1 1 2 + #define pr_fmt(fmt) "OF: " fmt 3 + 2 4 #include <linux/device.h> 3 5 #include <linux/io.h> 4 6 #include <linux/ioport.h> ··· 26 24 #ifdef DEBUG 27 25 static void of_dump_addr(const char *s, const __be32 *addr, int na) 28 26 { 29 - printk(KERN_DEBUG "%s", s); 27 + pr_debug("%s", s); 30 28 while (na--) 31 - printk(" %08x", be32_to_cpu(*(addr++))); 32 - printk("\n"); 29 + pr_cont(" %08x", be32_to_cpu(*(addr++))); 30 + pr_cont("\n"); 33 31 } 34 32 #else 35 33 static void of_dump_addr(const char *s, const __be32 *addr, int na) { } ··· 70 68 s = of_read_number(range + na + pna, ns); 71 69 da = of_read_number(addr, na); 72 70 73 - pr_debug("OF: default map, cp=%llx, s=%llx, da=%llx\n", 71 + pr_debug("default map, cp=%llx, s=%llx, da=%llx\n", 74 72 (unsigned long long)cp, (unsigned long long)s, 75 73 (unsigned long long)da); 76 74 ··· 158 156 s = of_read_number(range + na + pna, ns); 159 157 da = of_read_number(addr + 1, na - 1); 160 158 161 - pr_debug("OF: PCI map, cp=%llx, s=%llx, da=%llx\n", 159 + pr_debug("PCI map, cp=%llx, s=%llx, da=%llx\n", 162 160 (unsigned long long)cp, (unsigned long long)s, 163 161 (unsigned long long)da); 164 162 ··· 383 381 s = of_read_number(range + na + pna, ns); 384 382 da = of_read_number(addr + 1, na - 1); 385 383 386 - pr_debug("OF: ISA map, cp=%llx, s=%llx, da=%llx\n", 384 + pr_debug("ISA map, cp=%llx, s=%llx, da=%llx\n", 387 385 (unsigned long long)cp, (unsigned long long)s, 388 386 (unsigned long long)da); 389 387 ··· 506 504 */ 507 505 ranges = of_get_property(parent, rprop, &rlen); 508 506 if (ranges == NULL && !of_empty_ranges_quirk(parent)) { 509 - pr_debug("OF: no ranges; cannot translate\n"); 507 + pr_debug("no ranges; cannot translate\n"); 510 508 return 1; 511 509 } 512 510 if (ranges == NULL || rlen == 0) { 513 511 offset = of_read_number(addr, na); 514 512 memset(addr, 0, pna * 4); 515 - pr_debug("OF: empty ranges; 1:1 translation\n"); 513 + pr_debug("empty ranges; 1:1 translation\n"); 516 514 goto finish; 517 515 } 518 516 519 - pr_debug("OF: walking ranges...\n"); 517 + pr_debug("walking ranges...\n"); 520 518 521 519 /* Now walk through the ranges */ 522 520 rlen /= 4; ··· 527 525 break; 528 526 } 529 527 if (offset == OF_BAD_ADDR) { 530 - pr_debug("OF: not found !\n"); 528 + pr_debug("not found !\n"); 531 529 return 1; 532 530 } 533 531 memcpy(addr, ranges + na, 4 * pna); 534 532 535 533 finish: 536 - of_dump_addr("OF: parent translation for:", addr, pna); 537 - pr_debug("OF: with offset: %llx\n", (unsigned long long)offset); 534 + of_dump_addr("parent translation for:", addr, pna); 535 + pr_debug("with offset: %llx\n", (unsigned long long)offset); 538 536 539 537 /* Translate it into parent bus space */ 540 538 return pbus->translate(addr, offset, pna); ··· 559 557 int na, ns, pna, pns; 560 558 u64 result = OF_BAD_ADDR; 561 559 562 - pr_debug("OF: ** translation for device %s **\n", of_node_full_name(dev)); 560 + pr_debug("** translation for device %s **\n", of_node_full_name(dev)); 563 561 564 562 /* Increase refcount at current level */ 565 563 of_node_get(dev); ··· 573 571 /* Count address cells & copy address locally */ 574 572 bus->count_cells(dev, &na, &ns); 575 573 if (!OF_CHECK_COUNTS(na, ns)) { 576 - pr_debug("OF: Bad cell count for %s\n", of_node_full_name(dev)); 574 + pr_debug("Bad cell count for %s\n", of_node_full_name(dev)); 577 575 goto bail; 578 576 } 579 577 memcpy(addr, in_addr, na * 4); 580 578 581 - pr_debug("OF: bus is %s (na=%d, ns=%d) on %s\n", 579 + pr_debug("bus is %s (na=%d, ns=%d) on %s\n", 582 580 bus->name, na, ns, of_node_full_name(parent)); 583 - of_dump_addr("OF: translating address:", addr, na); 581 + of_dump_addr("translating address:", addr, na); 584 582 585 583 /* Translate */ 586 584 for (;;) { ··· 591 589 592 590 /* If root, we have finished */ 593 591 if (parent == NULL) { 594 - pr_debug("OF: reached root node\n"); 592 + pr_debug("reached root node\n"); 595 593 result = of_read_number(addr, na); 596 594 break; 597 595 } ··· 600 598 pbus = of_match_bus(parent); 601 599 pbus->count_cells(dev, &pna, &pns); 602 600 if (!OF_CHECK_COUNTS(pna, pns)) { 603 - pr_err("prom_parse: Bad cell count for %s\n", 601 + pr_err("Bad cell count for %s\n", 604 602 of_node_full_name(dev)); 605 603 break; 606 604 } 607 605 608 - pr_debug("OF: parent bus is %s (na=%d, ns=%d) on %s\n", 606 + pr_debug("parent bus is %s (na=%d, ns=%d) on %s\n", 609 607 pbus->name, pna, pns, of_node_full_name(parent)); 610 608 611 609 /* Apply bus translation */ ··· 617 615 ns = pns; 618 616 bus = pbus; 619 617 620 - of_dump_addr("OF: one level translation:", addr, na); 618 + of_dump_addr("one level translation:", addr, na); 621 619 } 622 620 bail: 623 621 of_node_put(parent); ··· 855 853 } 856 854 857 855 if (!ranges) { 858 - pr_debug("%s: no dma-ranges found for node(%s)\n", 859 - __func__, np->full_name); 856 + pr_debug("no dma-ranges found for node(%s)\n", np->full_name); 860 857 ret = -ENODEV; 861 858 goto out; 862 859 } ··· 872 871 dmaaddr = of_read_number(ranges, naddr); 873 872 *paddr = of_translate_dma_address(np, ranges); 874 873 if (*paddr == OF_BAD_ADDR) { 875 - pr_err("%s: translation of DMA address(%pad) to CPU address failed node(%s)\n", 876 - __func__, dma_addr, np->full_name); 874 + pr_err("translation of DMA address(%pad) to CPU address failed node(%s)\n", 875 + dma_addr, np->full_name); 877 876 ret = -EINVAL; 878 877 goto out; 879 878 }
+7 -4
drivers/of/base.c
··· 17 17 * as published by the Free Software Foundation; either version 18 18 * 2 of the License, or (at your option) any later version. 19 19 */ 20 + 21 + #define pr_fmt(fmt) "OF: " fmt 22 + 20 23 #include <linux/console.h> 21 24 #include <linux/ctype.h> 22 25 #include <linux/cpu.h> ··· 133 130 if (name == orig_name) { 134 131 name = kstrdup(orig_name, GFP_KERNEL); 135 132 } else { 136 - pr_warn("device-tree: Duplicate name in %s, renamed to \"%s\"\n", 133 + pr_warn("Duplicate name in %s, renamed to \"%s\"\n", 137 134 kobject_name(kobj), name); 138 135 } 139 136 return name; ··· 207 204 of_kset = kset_create_and_add("devicetree", NULL, firmware_kobj); 208 205 if (!of_kset) { 209 206 mutex_unlock(&of_mutex); 210 - pr_err("devicetree: failed to register existing nodes\n"); 207 + pr_err("failed to register existing nodes\n"); 211 208 return; 212 209 } 213 210 for_each_of_allnodes(np) ··· 2272 2269 of_node_put(node); 2273 2270 2274 2271 if (!port) { 2275 - pr_err("%s(): no port node found in %s\n", 2276 - __func__, parent->full_name); 2272 + pr_err("graph: no port node found in %s\n", 2273 + parent->full_name); 2277 2274 return NULL; 2278 2275 } 2279 2276 } else {
+24 -23
drivers/of/dynamic.c
··· 6 6 * device tree nodes. 7 7 */ 8 8 9 + #define pr_fmt(fmt) "OF: " fmt 10 + 9 11 #include <linux/of.h> 10 12 #include <linux/spinlock.h> 11 13 #include <linux/slab.h> ··· 98 96 switch (action) { 99 97 case OF_RECONFIG_ATTACH_NODE: 100 98 case OF_RECONFIG_DETACH_NODE: 101 - pr_debug("of/notify %-15s %s\n", action_names[action], 99 + pr_debug("notify %-15s %s\n", action_names[action], 102 100 pr->dn->full_name); 103 101 break; 104 102 case OF_RECONFIG_ADD_PROPERTY: 105 103 case OF_RECONFIG_REMOVE_PROPERTY: 106 104 case OF_RECONFIG_UPDATE_PROPERTY: 107 - pr_debug("of/notify %-15s %s:%s\n", action_names[action], 105 + pr_debug("notify %-15s %s:%s\n", action_names[action], 108 106 pr->dn->full_name, pr->prop->name); 109 107 break; 110 108 ··· 462 460 case OF_RECONFIG_ADD_PROPERTY: 463 461 case OF_RECONFIG_REMOVE_PROPERTY: 464 462 case OF_RECONFIG_UPDATE_PROPERTY: 465 - pr_debug("of/cset<%p> %-15s %s/%s\n", ce, action_names[ce->action], 463 + pr_debug("cset<%p> %-15s %s/%s\n", ce, action_names[ce->action], 466 464 ce->np->full_name, ce->prop->name); 467 465 break; 468 466 case OF_RECONFIG_ATTACH_NODE: 469 467 case OF_RECONFIG_DETACH_NODE: 470 - pr_debug("of/cset<%p> %-15s %s\n", ce, action_names[ce->action], 468 + pr_debug("cset<%p> %-15s %s\n", ce, action_names[ce->action], 471 469 ce->np->full_name); 472 470 break; 473 471 } ··· 533 531 ret = of_property_notify(ce->action, ce->np, ce->prop, ce->old_prop); 534 532 break; 535 533 default: 536 - pr_err("%s: invalid devicetree changeset action: %i\n", __func__, 534 + pr_err("invalid devicetree changeset action: %i\n", 537 535 (int)ce->action); 538 536 return; 539 537 } 540 538 541 539 if (ret) 542 - pr_err("%s: notifier error @%s\n", __func__, ce->np->full_name); 540 + pr_err("changeset notifier error @%s\n", ce->np->full_name); 543 541 } 544 542 545 543 static int __of_changeset_entry_apply(struct of_changeset_entry *ce) ··· 570 568 571 569 ret = __of_add_property(ce->np, ce->prop); 572 570 if (ret) { 573 - pr_err("%s: add_property failed @%s/%s\n", 574 - __func__, ce->np->full_name, 571 + pr_err("changeset: add_property failed @%s/%s\n", 572 + ce->np->full_name, 575 573 ce->prop->name); 576 574 break; 577 575 } ··· 579 577 case OF_RECONFIG_REMOVE_PROPERTY: 580 578 ret = __of_remove_property(ce->np, ce->prop); 581 579 if (ret) { 582 - pr_err("%s: remove_property failed @%s/%s\n", 583 - __func__, ce->np->full_name, 580 + pr_err("changeset: remove_property failed @%s/%s\n", 581 + ce->np->full_name, 584 582 ce->prop->name); 585 583 break; 586 584 } ··· 598 596 599 597 ret = __of_update_property(ce->np, ce->prop, &old_prop); 600 598 if (ret) { 601 - pr_err("%s: update_property failed @%s/%s\n", 602 - __func__, ce->np->full_name, 599 + pr_err("changeset: update_property failed @%s/%s\n", 600 + ce->np->full_name, 603 601 ce->prop->name); 604 602 break; 605 603 } ··· 679 677 int ret; 680 678 681 679 /* perform the rest of the work */ 682 - pr_debug("of_changeset: applying...\n"); 680 + pr_debug("changeset: applying...\n"); 683 681 list_for_each_entry(ce, &ocs->entries, node) { 684 682 ret = __of_changeset_entry_apply(ce); 685 683 if (ret) { 686 - pr_err("%s: Error applying changeset (%d)\n", __func__, ret); 684 + pr_err("Error applying changeset (%d)\n", ret); 687 685 list_for_each_entry_continue_reverse(ce, &ocs->entries, node) 688 686 __of_changeset_entry_revert(ce); 689 687 return ret; 690 688 } 691 689 } 692 - pr_debug("of_changeset: applied, emitting notifiers.\n"); 690 + pr_debug("changeset: applied, emitting notifiers.\n"); 693 691 694 692 /* drop the global lock while emitting notifiers */ 695 693 mutex_unlock(&of_mutex); 696 694 list_for_each_entry(ce, &ocs->entries, node) 697 695 __of_changeset_entry_notify(ce, 0); 698 696 mutex_lock(&of_mutex); 699 - pr_debug("of_changeset: notifiers sent.\n"); 697 + pr_debug("changeset: notifiers sent.\n"); 700 698 701 699 return 0; 702 700 } ··· 730 728 struct of_changeset_entry *ce; 731 729 int ret; 732 730 733 - pr_debug("of_changeset: reverting...\n"); 731 + pr_debug("changeset: reverting...\n"); 734 732 list_for_each_entry_reverse(ce, &ocs->entries, node) { 735 733 ret = __of_changeset_entry_revert(ce); 736 734 if (ret) { 737 - pr_err("%s: Error reverting changeset (%d)\n", __func__, ret); 735 + pr_err("Error reverting changeset (%d)\n", ret); 738 736 list_for_each_entry_continue(ce, &ocs->entries, node) 739 737 __of_changeset_entry_apply(ce); 740 738 return ret; 741 739 } 742 740 } 743 - pr_debug("of_changeset: reverted, emitting notifiers.\n"); 741 + pr_debug("changeset: reverted, emitting notifiers.\n"); 744 742 745 743 /* drop the global lock while emitting notifiers */ 746 744 mutex_unlock(&of_mutex); 747 745 list_for_each_entry_reverse(ce, &ocs->entries, node) 748 746 __of_changeset_entry_notify(ce, 1); 749 747 mutex_lock(&of_mutex); 750 - pr_debug("of_changeset: notifiers sent.\n"); 748 + pr_debug("changeset: notifiers sent.\n"); 751 749 752 750 return 0; 753 751 } ··· 797 795 struct of_changeset_entry *ce; 798 796 799 797 ce = kzalloc(sizeof(*ce), GFP_KERNEL); 800 - if (!ce) { 801 - pr_err("%s: Failed to allocate\n", __func__); 798 + if (!ce) 802 799 return -ENOMEM; 803 - } 800 + 804 801 /* get a reference to the node */ 805 802 ce->action = action; 806 803 ce->np = of_node_get(np);
+6 -6
drivers/of/fdt.c
··· 9 9 * version 2 as published by the Free Software Foundation. 10 10 */ 11 11 12 + #define pr_fmt(fmt) "OF: fdt:" fmt 13 + 12 14 #include <linux/crc32.h> 13 15 #include <linux/kernel.h> 14 16 #include <linux/initrd.h> ··· 184 182 185 183 val = fdt_getprop_by_offset(blob, cur, &pname, &sz); 186 184 if (!val) { 187 - pr_warn("%s: Cannot locate property at 0x%x\n", 188 - __func__, cur); 185 + pr_warn("Cannot locate property at 0x%x\n", cur); 189 186 continue; 190 187 } 191 188 192 189 if (!pname) { 193 - pr_warn("%s: Cannot find property name at 0x%x\n", 194 - __func__, cur); 190 + pr_warn("Cannot find property name at 0x%x\n", cur); 195 191 continue; 196 192 } 197 193 ··· 439 439 } 440 440 441 441 if (offset < 0 && offset != -FDT_ERR_NOTFOUND) { 442 - pr_err("%s: Error %d processing FDT\n", __func__, offset); 442 + pr_err("Error %d processing FDT\n", offset); 443 443 return -EINVAL; 444 444 } 445 445 ··· 1281 1281 1282 1282 if (of_fdt_crc32 != crc32_be(~0, initial_boot_params, 1283 1283 fdt_totalsize(initial_boot_params))) { 1284 - pr_warn("fdt: not creating '/sys/firmware/fdt': CRC check failed\n"); 1284 + pr_warn("not creating '/sys/firmware/fdt': CRC check failed\n"); 1285 1285 return 0; 1286 1286 } 1287 1287 of_fdt_raw_attr.size = fdt_totalsize(initial_boot_params);
+19 -16
drivers/of/fdt_address.c
··· 12 12 * the Free Software Foundation; either version 2, or (at your option) 13 13 * any later version. 14 14 */ 15 + 16 + #define pr_fmt(fmt) "OF: fdt: " fmt 17 + 15 18 #include <linux/kernel.h> 16 19 #include <linux/libfdt.h> 17 20 #include <linux/of.h> ··· 33 30 pr_debug("%s", s); 34 31 while(na--) 35 32 pr_cont(" %08x", *(addr++)); 36 - pr_debug("\n"); 33 + pr_cont("\n"); 37 34 } 38 35 #else 39 36 static void __init of_dump_addr(const char *s, const __be32 *addr, int na) { } ··· 80 77 s = of_read_number(range + na + pna, ns); 81 78 da = of_read_number(addr, na); 82 79 83 - pr_debug("FDT: default map, cp=%llx, s=%llx, da=%llx\n", 80 + pr_debug("default map, cp=%llx, s=%llx, da=%llx\n", 84 81 cp, s, da); 85 82 86 83 if (da < cp || da >= (cp + s)) ··· 126 123 if (rlen == 0) { 127 124 offset = of_read_number(addr, na); 128 125 memset(addr, 0, pna * 4); 129 - pr_debug("FDT: empty ranges, 1:1 translation\n"); 126 + pr_debug("empty ranges, 1:1 translation\n"); 130 127 goto finish; 131 128 } 132 129 133 - pr_debug("FDT: walking ranges...\n"); 130 + pr_debug("walking ranges...\n"); 134 131 135 132 /* Now walk through the ranges */ 136 133 rlen /= 4; ··· 141 138 break; 142 139 } 143 140 if (offset == OF_BAD_ADDR) { 144 - pr_debug("FDT: not found !\n"); 141 + pr_debug("not found !\n"); 145 142 return 1; 146 143 } 147 144 memcpy(addr, ranges + na, 4 * pna); 148 145 149 146 finish: 150 - of_dump_addr("FDT: parent translation for:", addr, pna); 151 - pr_debug("FDT: with offset: %llx\n", offset); 147 + of_dump_addr("parent translation for:", addr, pna); 148 + pr_debug("with offset: %llx\n", offset); 152 149 153 150 /* Translate it into parent bus space */ 154 151 return pbus->translate(addr, offset, pna); ··· 173 170 int na, ns, pna, pns; 174 171 u64 result = OF_BAD_ADDR; 175 172 176 - pr_debug("FDT: ** translation for device %s **\n", 173 + pr_debug("** translation for device %s **\n", 177 174 fdt_get_name(blob, node_offset, NULL)); 178 175 179 176 reg = fdt_getprop(blob, node_offset, "reg", &len); 180 177 if (!reg) { 181 - pr_err("FDT: warning: device tree node '%s' has no address.\n", 178 + pr_err("warning: device tree node '%s' has no address.\n", 182 179 fdt_get_name(blob, node_offset, NULL)); 183 180 goto bail; 184 181 } ··· 192 189 /* Cound address cells & copy address locally */ 193 190 bus->count_cells(blob, parent, &na, &ns); 194 191 if (!OF_CHECK_COUNTS(na, ns)) { 195 - pr_err("FDT: Bad cell count for %s\n", 192 + pr_err("Bad cell count for %s\n", 196 193 fdt_get_name(blob, node_offset, NULL)); 197 194 goto bail; 198 195 } 199 196 memcpy(addr, reg, na * 4); 200 197 201 - pr_debug("FDT: bus (na=%d, ns=%d) on %s\n", 198 + pr_debug("bus (na=%d, ns=%d) on %s\n", 202 199 na, ns, fdt_get_name(blob, parent, NULL)); 203 - of_dump_addr("OF: translating address:", addr, na); 200 + of_dump_addr("translating address:", addr, na); 204 201 205 202 /* Translate */ 206 203 for (;;) { ··· 210 207 211 208 /* If root, we have finished */ 212 209 if (parent < 0) { 213 - pr_debug("FDT: reached root node\n"); 210 + pr_debug("reached root node\n"); 214 211 result = of_read_number(addr, na); 215 212 break; 216 213 } ··· 219 216 pbus = &of_busses[0]; 220 217 pbus->count_cells(blob, parent, &pna, &pns); 221 218 if (!OF_CHECK_COUNTS(pna, pns)) { 222 - pr_err("FDT: Bad cell count for %s\n", 219 + pr_err("Bad cell count for %s\n", 223 220 fdt_get_name(blob, node_offset, NULL)); 224 221 break; 225 222 } 226 223 227 - pr_debug("FDT: parent bus (na=%d, ns=%d) on %s\n", 224 + pr_debug("parent bus (na=%d, ns=%d) on %s\n", 228 225 pna, pns, fdt_get_name(blob, parent, NULL)); 229 226 230 227 /* Apply bus translation */ ··· 237 234 ns = pns; 238 235 bus = pbus; 239 236 240 - of_dump_addr("FDT: one level translation:", addr, na); 237 + of_dump_addr("one level translation:", addr, na); 241 238 } 242 239 bail: 243 240 return result;
+2
drivers/of/irq.c
··· 18 18 * driver. 19 19 */ 20 20 21 + #define pr_fmt(fmt) "OF: " fmt 22 + 21 23 #include <linux/device.h> 22 24 #include <linux/errno.h> 23 25 #include <linux/list.h>
+4 -2
drivers/of/of_pci.c
··· 1 + #define pr_fmt(fmt) "OF: PCI: " fmt 2 + 1 3 #include <linux/kernel.h> 2 4 #include <linux/export.h> 3 5 #include <linux/of.h> ··· 140 138 else 141 139 pci_clear_flags(PCI_PROBE_ONLY); 142 140 143 - pr_info("PCI: PROBE_ONLY %sabled\n", val ? "en" : "dis"); 141 + pr_info("PROBE_ONLY %sabled\n", val ? "en" : "dis"); 144 142 } 145 143 EXPORT_SYMBOL_GPL(of_pci_check_probe_only); 146 144 ··· 183 181 if (!bus_range) 184 182 return -ENOMEM; 185 183 186 - pr_info("PCI host bridge %s ranges:\n", dev->full_name); 184 + pr_info("host bridge %s ranges:\n", dev->full_name); 187 185 188 186 err = of_pci_parse_bus_range(dev, bus_range); 189 187 if (err) {
+11 -11
drivers/of/of_reserved_mem.c
··· 13 13 * License or (at your optional) any later version of the license. 14 14 */ 15 15 16 + #define pr_fmt(fmt) "OF: reserved mem: " fmt 17 + 16 18 #include <linux/err.h> 17 19 #include <linux/of.h> 18 20 #include <linux/of_fdt.h> ··· 77 75 struct reserved_mem *rmem = &reserved_mem[reserved_mem_count]; 78 76 79 77 if (reserved_mem_count == ARRAY_SIZE(reserved_mem)) { 80 - pr_err("Reserved memory: not enough space all defined regions.\n"); 78 + pr_err("not enough space all defined regions.\n"); 81 79 return; 82 80 } 83 81 ··· 110 108 return -EINVAL; 111 109 112 110 if (len != dt_root_size_cells * sizeof(__be32)) { 113 - pr_err("Reserved memory: invalid size property in '%s' node.\n", 114 - uname); 111 + pr_err("invalid size property in '%s' node.\n", uname); 115 112 return -EINVAL; 116 113 } 117 114 size = dt_mem_next_cell(dt_root_size_cells, &prop); ··· 120 119 prop = of_get_flat_dt_prop(node, "alignment", &len); 121 120 if (prop) { 122 121 if (len != dt_root_addr_cells * sizeof(__be32)) { 123 - pr_err("Reserved memory: invalid alignment property in '%s' node.\n", 122 + pr_err("invalid alignment property in '%s' node.\n", 124 123 uname); 125 124 return -EINVAL; 126 125 } ··· 142 141 if (prop) { 143 142 144 143 if (len % t_len != 0) { 145 - pr_err("Reserved memory: invalid alloc-ranges property in '%s', skipping node.\n", 144 + pr_err("invalid alloc-ranges property in '%s', skipping node.\n", 146 145 uname); 147 146 return -EINVAL; 148 147 } ··· 157 156 ret = early_init_dt_alloc_reserved_memory_arch(size, 158 157 align, start, end, nomap, &base); 159 158 if (ret == 0) { 160 - pr_debug("Reserved memory: allocated memory for '%s' node: base %pa, size %ld MiB\n", 159 + pr_debug("allocated memory for '%s' node: base %pa, size %ld MiB\n", 161 160 uname, &base, 162 161 (unsigned long)size / SZ_1M); 163 162 break; ··· 169 168 ret = early_init_dt_alloc_reserved_memory_arch(size, align, 170 169 0, 0, nomap, &base); 171 170 if (ret == 0) 172 - pr_debug("Reserved memory: allocated memory for '%s' node: base %pa, size %ld MiB\n", 171 + pr_debug("allocated memory for '%s' node: base %pa, size %ld MiB\n", 173 172 uname, &base, (unsigned long)size / SZ_1M); 174 173 } 175 174 176 175 if (base == 0) { 177 - pr_info("Reserved memory: failed to allocate memory for node '%s'\n", 178 - uname); 176 + pr_info("failed to allocate memory for node '%s'\n", uname); 179 177 return -ENOMEM; 180 178 } 181 179 ··· 203 203 continue; 204 204 205 205 if (initfn(rmem) == 0) { 206 - pr_info("Reserved memory: initialized node %s, compatible id %s\n", 206 + pr_info("initialized node %s, compatible id %s\n", 207 207 rmem->name, compat); 208 208 return 0; 209 209 } ··· 245 245 246 246 this_end = this->base + this->size; 247 247 next_end = next->base + next->size; 248 - pr_err("Reserved memory: OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n", 248 + pr_err("OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n", 249 249 this->name, &this->base, &this_end, 250 250 next->name, &next->base, &next_end); 251 251 }
+16 -27
drivers/of/overlay.c
··· 8 8 * modify it under the terms of the GNU General Public License 9 9 * version 2 as published by the Free Software Foundation. 10 10 */ 11 - #undef DEBUG 11 + 12 + #define pr_fmt(fmt) "OF: overlay: " fmt 13 + 12 14 #include <linux/kernel.h> 13 15 #include <linux/module.h> 14 16 #include <linux/of.h> ··· 139 137 for_each_property_of_node(overlay, prop) { 140 138 ret = of_overlay_apply_single_property(ov, target, prop); 141 139 if (ret) { 142 - pr_err("%s: Failed to apply prop @%s/%s\n", 143 - __func__, target->full_name, prop->name); 140 + pr_err("Failed to apply prop @%s/%s\n", 141 + target->full_name, prop->name); 144 142 return ret; 145 143 } 146 144 } ··· 148 146 for_each_child_of_node(overlay, child) { 149 147 ret = of_overlay_apply_single_device_node(ov, target, child); 150 148 if (ret != 0) { 151 - pr_err("%s: Failed to apply single node @%s/%s\n", 152 - __func__, target->full_name, 153 - child->name); 149 + pr_err("Failed to apply single node @%s/%s\n", 150 + target->full_name, child->name); 154 151 of_node_put(child); 155 152 return ret; 156 153 } ··· 177 176 178 177 err = of_overlay_apply_one(ov, ovinfo->target, ovinfo->overlay); 179 178 if (err != 0) { 180 - pr_err("%s: overlay failed '%s'\n", 181 - __func__, ovinfo->target->full_name); 179 + pr_err("apply failed '%s'\n", ovinfo->target->full_name); 182 180 return err; 183 181 } 184 182 } ··· 208 208 if (ret == 0) 209 209 return of_find_node_by_path(path); 210 210 211 - pr_err("%s: Failed to find target for node %p (%s)\n", __func__, 211 + pr_err("Failed to find target for node %p (%s)\n", 212 212 info_node, info_node->name); 213 213 214 214 return NULL; ··· 355 355 356 356 id = idr_alloc(&ov_idr, ov, 0, 0, GFP_KERNEL); 357 357 if (id < 0) { 358 - pr_err("%s: idr_alloc() failed for tree@%s\n", 359 - __func__, tree->full_name); 360 358 err = id; 361 359 goto err_destroy_trans; 362 360 } ··· 363 365 /* build the overlay info structures */ 364 366 err = of_build_overlay_info(ov, tree); 365 367 if (err) { 366 - pr_err("%s: of_build_overlay_info() failed for tree@%s\n", 367 - __func__, tree->full_name); 368 + pr_err("of_build_overlay_info() failed for tree@%s\n", 369 + tree->full_name); 368 370 goto err_free_idr; 369 371 } 370 372 371 373 /* apply the overlay */ 372 374 err = of_overlay_apply(ov); 373 - if (err) { 374 - pr_err("%s: of_overlay_apply() failed for tree@%s\n", 375 - __func__, tree->full_name); 375 + if (err) 376 376 goto err_abort_trans; 377 - } 378 377 379 378 /* apply the changeset */ 380 379 err = __of_changeset_apply(&ov->cset); 381 - if (err) { 382 - pr_err("%s: __of_changeset_apply() failed for tree@%s\n", 383 - __func__, tree->full_name); 380 + if (err) 384 381 goto err_revert_overlay; 385 - } 382 + 386 383 387 384 /* add to the tail of the overlay list */ 388 385 list_add_tail(&ov->node, &ov_list); ··· 462 469 463 470 list_for_each_entry(ce, &ov->cset.entries, node) { 464 471 if (!overlay_is_topmost(ov, ce->np)) { 465 - pr_err("%s: overlay #%d is not topmost\n", 466 - __func__, ov->id); 472 + pr_err("overlay #%d is not topmost\n", ov->id); 467 473 return 0; 468 474 } 469 475 } ··· 488 496 ov = idr_find(&ov_idr, id); 489 497 if (ov == NULL) { 490 498 err = -ENODEV; 491 - pr_err("%s: Could not find overlay #%d\n", 492 - __func__, id); 499 + pr_err("destroy: Could not find overlay #%d\n", id); 493 500 goto out; 494 501 } 495 502 496 503 /* check whether the overlay is safe to remove */ 497 504 if (!overlay_removal_is_ok(ov)) { 498 505 err = -EBUSY; 499 - pr_err("%s: removal check failed for overlay #%d\n", 500 - __func__, id); 501 506 goto out; 502 507 } 503 508
+8 -8
drivers/of/platform.c
··· 11 11 * 2 of the License, or (at your option) any later version. 12 12 * 13 13 */ 14 + 15 + #define pr_fmt(fmt) "OF: " fmt 16 + 14 17 #include <linux/errno.h> 15 18 #include <linux/module.h> 16 19 #include <linux/amba/bus.h> ··· 236 233 return NULL; 237 234 238 235 dev = amba_device_alloc(NULL, 0, 0); 239 - if (!dev) { 240 - pr_err("%s(): amba_device_alloc() failed for %s\n", 241 - __func__, node->full_name); 236 + if (!dev) 242 237 goto err_clear_flag; 243 - } 244 238 245 239 /* setup generic device info */ 246 240 dev->dev.of_node = of_node_get(node); ··· 260 260 261 261 ret = of_address_to_resource(node, 0, &dev->res); 262 262 if (ret) { 263 - pr_err("%s(): of_address_to_resource() failed (%d) for %s\n", 264 - __func__, ret, node->full_name); 263 + pr_err("amba: of_address_to_resource() failed (%d) for %s\n", 264 + ret, node->full_name); 265 265 goto err_free; 266 266 } 267 267 268 268 ret = amba_device_add(dev, &iomem_resource); 269 269 if (ret) { 270 - pr_err("%s(): amba_device_add() failed (%d) for %s\n", 271 - __func__, ret, node->full_name); 270 + pr_err("amba_device_add() failed (%d) for %s\n", 271 + ret, node->full_name); 272 272 goto err_free; 273 273 } 274 274
+2
drivers/of/resolver.c
··· 9 9 * version 2 as published by the Free Software Foundation. 10 10 */ 11 11 12 + #define pr_fmt(fmt) "OF: resolver: " fmt 13 + 12 14 #include <linux/kernel.h> 13 15 #include <linux/module.h> 14 16 #include <linux/of.h>