diff options
author | Fu Wei <fu.wei@linaro.org> | 2017-01-18 08:25:25 -0500 |
---|---|---|
committer | Mark Rutland <mark.rutland@arm.com> | 2017-04-10 09:25:34 -0400 |
commit | ded24019b6b6f18ed079bbabc89832cd68959748 (patch) | |
tree | 13095dca6f3140c286ddfbf80a6501994b4042ce /drivers/clocksource/arm_arch_timer.c | |
parent | d003d029cea8a28139b4f9b88a36b8fac864f45b (diff) |
clocksource: arm_arch_timer: clean up printk usage
Almost all string in the arm_arch_timer driver duplicate an common
prefix (though a few do not). For consistency, it would be better to use
pr_fmt(), and always use this prefix. At the same time, we may as well
clean up some whitespace issues in arch_timer_banner and
arch_timer_init.
No functional change.
Signed-off-by: Fu Wei <fu.wei@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
[Mark: reword commit message]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Diffstat (limited to 'drivers/clocksource/arm_arch_timer.c')
-rw-r--r-- | drivers/clocksource/arm_arch_timer.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index bf9e9d76375e..467ee6197c3f 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c | |||
@@ -33,6 +33,9 @@ | |||
33 | 33 | ||
34 | #include <clocksource/arm_arch_timer.h> | 34 | #include <clocksource/arm_arch_timer.h> |
35 | 35 | ||
36 | #undef pr_fmt | ||
37 | #define pr_fmt(fmt) "arch_timer: " fmt | ||
38 | |||
36 | #define CNTTIDR 0x08 | 39 | #define CNTTIDR 0x08 |
37 | #define CNTTIDR_VIRT(n) (BIT(1) << ((n) * 4)) | 40 | #define CNTTIDR_VIRT(n) (BIT(1) << ((n) * 4)) |
38 | 41 | ||
@@ -846,22 +849,22 @@ arch_timer_detect_rate(void __iomem *cntbase, struct device_node *np) | |||
846 | 849 | ||
847 | /* Check the timer frequency. */ | 850 | /* Check the timer frequency. */ |
848 | if (arch_timer_rate == 0) | 851 | if (arch_timer_rate == 0) |
849 | pr_warn("Architected timer frequency not available\n"); | 852 | pr_warn("frequency not available\n"); |
850 | } | 853 | } |
851 | 854 | ||
852 | static void arch_timer_banner(unsigned type) | 855 | static void arch_timer_banner(unsigned type) |
853 | { | 856 | { |
854 | pr_info("Architected %s%s%s timer(s) running at %lu.%02luMHz (%s%s%s).\n", | 857 | pr_info("%s%s%s timer(s) running at %lu.%02luMHz (%s%s%s).\n", |
855 | type & ARCH_CP15_TIMER ? "cp15" : "", | 858 | type & ARCH_CP15_TIMER ? "cp15" : "", |
856 | type == (ARCH_CP15_TIMER | ARCH_MEM_TIMER) ? " and " : "", | 859 | type == (ARCH_CP15_TIMER | ARCH_MEM_TIMER) ? " and " : "", |
857 | type & ARCH_MEM_TIMER ? "mmio" : "", | 860 | type & ARCH_MEM_TIMER ? "mmio" : "", |
858 | (unsigned long)arch_timer_rate / 1000000, | 861 | (unsigned long)arch_timer_rate / 1000000, |
859 | (unsigned long)(arch_timer_rate / 10000) % 100, | 862 | (unsigned long)(arch_timer_rate / 10000) % 100, |
860 | type & ARCH_CP15_TIMER ? | 863 | type & ARCH_CP15_TIMER ? |
861 | (arch_timer_uses_ppi == VIRT_PPI) ? "virt" : "phys" : | 864 | (arch_timer_uses_ppi == VIRT_PPI) ? "virt" : "phys" : |
862 | "", | 865 | "", |
863 | type == (ARCH_CP15_TIMER | ARCH_MEM_TIMER) ? "/" : "", | 866 | type == (ARCH_CP15_TIMER | ARCH_MEM_TIMER) ? "/" : "", |
864 | type & ARCH_MEM_TIMER ? | 867 | type & ARCH_MEM_TIMER ? |
865 | arch_timer_mem_use_virtual ? "virt" : "phys" : | 868 | arch_timer_mem_use_virtual ? "virt" : "phys" : |
866 | ""); | 869 | ""); |
867 | } | 870 | } |
@@ -922,8 +925,7 @@ static void __init arch_counter_register(unsigned type) | |||
922 | 925 | ||
923 | static void arch_timer_stop(struct clock_event_device *clk) | 926 | static void arch_timer_stop(struct clock_event_device *clk) |
924 | { | 927 | { |
925 | pr_debug("arch_timer_teardown disable IRQ%d cpu #%d\n", | 928 | pr_debug("disable IRQ%d cpu #%d\n", clk->irq, smp_processor_id()); |
926 | clk->irq, smp_processor_id()); | ||
927 | 929 | ||
928 | disable_percpu_irq(arch_timer_ppi[arch_timer_uses_ppi]); | 930 | disable_percpu_irq(arch_timer_ppi[arch_timer_uses_ppi]); |
929 | if (arch_timer_has_nonsecure_ppi()) | 931 | if (arch_timer_has_nonsecure_ppi()) |
@@ -1016,8 +1018,7 @@ static int __init arch_timer_register(void) | |||
1016 | } | 1018 | } |
1017 | 1019 | ||
1018 | if (err) { | 1020 | if (err) { |
1019 | pr_err("arch_timer: can't register interrupt %d (%d)\n", | 1021 | pr_err("can't register interrupt %d (%d)\n", ppi, err); |
1020 | ppi, err); | ||
1021 | goto out_free; | 1022 | goto out_free; |
1022 | } | 1023 | } |
1023 | 1024 | ||
@@ -1070,7 +1071,7 @@ static int __init arch_timer_mem_register(void __iomem *base, unsigned int irq) | |||
1070 | 1071 | ||
1071 | ret = request_irq(irq, func, IRQF_TIMER, "arch_mem_timer", &t->evt); | 1072 | ret = request_irq(irq, func, IRQF_TIMER, "arch_mem_timer", &t->evt); |
1072 | if (ret) { | 1073 | if (ret) { |
1073 | pr_err("arch_timer: Failed to request mem timer irq\n"); | 1074 | pr_err("Failed to request mem timer irq\n"); |
1074 | kfree(t); | 1075 | kfree(t); |
1075 | } | 1076 | } |
1076 | 1077 | ||
@@ -1148,7 +1149,7 @@ static int __init arch_timer_init(void) | |||
1148 | } | 1149 | } |
1149 | 1150 | ||
1150 | if (!has_ppi) { | 1151 | if (!has_ppi) { |
1151 | pr_warn("arch_timer: No interrupt available, giving up\n"); | 1152 | pr_warn("No interrupt available, giving up\n"); |
1152 | return -EINVAL; | 1153 | return -EINVAL; |
1153 | } | 1154 | } |
1154 | } | 1155 | } |
@@ -1162,7 +1163,7 @@ static int __init arch_timer_init(void) | |||
1162 | return ret; | 1163 | return ret; |
1163 | 1164 | ||
1164 | arch_timer_kvm_info.virtual_irq = arch_timer_ppi[VIRT_PPI]; | 1165 | arch_timer_kvm_info.virtual_irq = arch_timer_ppi[VIRT_PPI]; |
1165 | 1166 | ||
1166 | return 0; | 1167 | return 0; |
1167 | } | 1168 | } |
1168 | 1169 | ||
@@ -1171,7 +1172,7 @@ static int __init arch_timer_of_init(struct device_node *np) | |||
1171 | int i; | 1172 | int i; |
1172 | 1173 | ||
1173 | if (arch_timers_present & ARCH_CP15_TIMER) { | 1174 | if (arch_timers_present & ARCH_CP15_TIMER) { |
1174 | pr_warn("arch_timer: multiple nodes in dt, skipping\n"); | 1175 | pr_warn("multiple nodes in dt, skipping\n"); |
1175 | return 0; | 1176 | return 0; |
1176 | } | 1177 | } |
1177 | 1178 | ||
@@ -1213,7 +1214,7 @@ static int __init arch_timer_mem_init(struct device_node *np) | |||
1213 | arch_timers_present |= ARCH_MEM_TIMER; | 1214 | arch_timers_present |= ARCH_MEM_TIMER; |
1214 | cntctlbase = of_iomap(np, 0); | 1215 | cntctlbase = of_iomap(np, 0); |
1215 | if (!cntctlbase) { | 1216 | if (!cntctlbase) { |
1216 | pr_err("arch_timer: Can't find CNTCTLBase\n"); | 1217 | pr_err("Can't find CNTCTLBase\n"); |
1217 | return -ENXIO; | 1218 | return -ENXIO; |
1218 | } | 1219 | } |
1219 | 1220 | ||
@@ -1228,7 +1229,7 @@ static int __init arch_timer_mem_init(struct device_node *np) | |||
1228 | u32 cntacr; | 1229 | u32 cntacr; |
1229 | 1230 | ||
1230 | if (of_property_read_u32(frame, "frame-number", &n)) { | 1231 | if (of_property_read_u32(frame, "frame-number", &n)) { |
1231 | pr_err("arch_timer: Missing frame-number\n"); | 1232 | pr_err("Missing frame-number\n"); |
1232 | of_node_put(frame); | 1233 | of_node_put(frame); |
1233 | goto out; | 1234 | goto out; |
1234 | } | 1235 | } |
@@ -1258,7 +1259,7 @@ static int __init arch_timer_mem_init(struct device_node *np) | |||
1258 | base = arch_counter_base = of_io_request_and_map(best_frame, 0, | 1259 | base = arch_counter_base = of_io_request_and_map(best_frame, 0, |
1259 | "arch_mem_timer"); | 1260 | "arch_mem_timer"); |
1260 | if (IS_ERR(base)) { | 1261 | if (IS_ERR(base)) { |
1261 | pr_err("arch_timer: Can't map frame's registers\n"); | 1262 | pr_err("Can't map frame's registers\n"); |
1262 | goto out; | 1263 | goto out; |
1263 | } | 1264 | } |
1264 | 1265 | ||
@@ -1269,7 +1270,7 @@ static int __init arch_timer_mem_init(struct device_node *np) | |||
1269 | 1270 | ||
1270 | ret = -EINVAL; | 1271 | ret = -EINVAL; |
1271 | if (!irq) { | 1272 | if (!irq) { |
1272 | pr_err("arch_timer: Frame missing %s irq", | 1273 | pr_err("Frame missing %s irq.\n", |
1273 | arch_timer_mem_use_virtual ? "virt" : "phys"); | 1274 | arch_timer_mem_use_virtual ? "virt" : "phys"); |
1274 | goto out; | 1275 | goto out; |
1275 | } | 1276 | } |
@@ -1311,7 +1312,7 @@ static int __init arch_timer_acpi_init(struct acpi_table_header *table) | |||
1311 | struct acpi_table_gtdt *gtdt; | 1312 | struct acpi_table_gtdt *gtdt; |
1312 | 1313 | ||
1313 | if (arch_timers_present & ARCH_CP15_TIMER) { | 1314 | if (arch_timers_present & ARCH_CP15_TIMER) { |
1314 | pr_warn("arch_timer: already initialized, skipping\n"); | 1315 | pr_warn("already initialized, skipping\n"); |
1315 | return -EINVAL; | 1316 | return -EINVAL; |
1316 | } | 1317 | } |
1317 | 1318 | ||