diff options
author | Rob Herring <robh@kernel.org> | 2017-07-18 17:42:53 -0400 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2017-08-31 09:56:17 -0400 |
commit | 469869d18a886e046161ca65516bd3ffcd2f804b (patch) | |
tree | aad37b7210699c861ea71ae9674000aae988d01b | |
parent | ebbe266509d8a5453f51f77277da65d870125b72 (diff) |
clocksource: Convert to using %pOF instead of full_name
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: linux-arm-kernel@lists.infradead.org
Acked-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r-- | drivers/clocksource/tango_xtal.c | 6 | ||||
-rw-r--r-- | drivers/clocksource/timer-of.c | 11 | ||||
-rw-r--r-- | drivers/clocksource/timer-probe.c | 3 | ||||
-rw-r--r-- | drivers/clocksource/timer-stm32.c | 8 |
4 files changed, 13 insertions, 15 deletions
diff --git a/drivers/clocksource/tango_xtal.c b/drivers/clocksource/tango_xtal.c index c4e1c2e6046f..6a8d9838ce33 100644 --- a/drivers/clocksource/tango_xtal.c +++ b/drivers/clocksource/tango_xtal.c | |||
@@ -26,13 +26,13 @@ static int __init tango_clocksource_init(struct device_node *np) | |||
26 | 26 | ||
27 | xtal_in_cnt = of_iomap(np, 0); | 27 | xtal_in_cnt = of_iomap(np, 0); |
28 | if (xtal_in_cnt == NULL) { | 28 | if (xtal_in_cnt == NULL) { |
29 | pr_err("%s: invalid address\n", np->full_name); | 29 | pr_err("%pOF: invalid address\n", np); |
30 | return -ENXIO; | 30 | return -ENXIO; |
31 | } | 31 | } |
32 | 32 | ||
33 | clk = of_clk_get(np, 0); | 33 | clk = of_clk_get(np, 0); |
34 | if (IS_ERR(clk)) { | 34 | if (IS_ERR(clk)) { |
35 | pr_err("%s: invalid clock\n", np->full_name); | 35 | pr_err("%pOF: invalid clock\n", np); |
36 | return PTR_ERR(clk); | 36 | return PTR_ERR(clk); |
37 | } | 37 | } |
38 | 38 | ||
@@ -43,7 +43,7 @@ static int __init tango_clocksource_init(struct device_node *np) | |||
43 | ret = clocksource_mmio_init(xtal_in_cnt, "tango-xtal", xtal_freq, 350, | 43 | ret = clocksource_mmio_init(xtal_in_cnt, "tango-xtal", xtal_freq, 350, |
44 | 32, clocksource_mmio_readl_up); | 44 | 32, clocksource_mmio_readl_up); |
45 | if (ret) { | 45 | if (ret) { |
46 | pr_err("%s: registration failed\n", np->full_name); | 46 | pr_err("%pOF: registration failed\n", np); |
47 | return ret; | 47 | return ret; |
48 | } | 48 | } |
49 | 49 | ||
diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index d509b500a7b5..64e00dd41e6f 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c | |||
@@ -52,7 +52,7 @@ static __init int timer_irq_init(struct device_node *np, | |||
52 | of_irq->irq = irq_of_parse_and_map(np, of_irq->index); | 52 | of_irq->irq = irq_of_parse_and_map(np, of_irq->index); |
53 | } | 53 | } |
54 | if (!of_irq->irq) { | 54 | if (!of_irq->irq) { |
55 | pr_err("Failed to map interrupt for %s\n", np->full_name); | 55 | pr_err("Failed to map interrupt for %pOF\n", np); |
56 | return -EINVAL; | 56 | return -EINVAL; |
57 | } | 57 | } |
58 | 58 | ||
@@ -63,8 +63,7 @@ static __init int timer_irq_init(struct device_node *np, | |||
63 | of_irq->flags ? of_irq->flags : IRQF_TIMER, | 63 | of_irq->flags ? of_irq->flags : IRQF_TIMER, |
64 | np->full_name, clkevt); | 64 | np->full_name, clkevt); |
65 | if (ret) { | 65 | if (ret) { |
66 | pr_err("Failed to request irq %d for %s\n", of_irq->irq, | 66 | pr_err("Failed to request irq %d for %pOF\n", of_irq->irq, np); |
67 | np->full_name); | ||
68 | return ret; | 67 | return ret; |
69 | } | 68 | } |
70 | 69 | ||
@@ -88,20 +87,20 @@ static __init int timer_clk_init(struct device_node *np, | |||
88 | of_clk->clk = of_clk->name ? of_clk_get_by_name(np, of_clk->name) : | 87 | of_clk->clk = of_clk->name ? of_clk_get_by_name(np, of_clk->name) : |
89 | of_clk_get(np, of_clk->index); | 88 | of_clk_get(np, of_clk->index); |
90 | if (IS_ERR(of_clk->clk)) { | 89 | if (IS_ERR(of_clk->clk)) { |
91 | pr_err("Failed to get clock for %s\n", np->full_name); | 90 | pr_err("Failed to get clock for %pOF\n", np); |
92 | return PTR_ERR(of_clk->clk); | 91 | return PTR_ERR(of_clk->clk); |
93 | } | 92 | } |
94 | 93 | ||
95 | ret = clk_prepare_enable(of_clk->clk); | 94 | ret = clk_prepare_enable(of_clk->clk); |
96 | if (ret) { | 95 | if (ret) { |
97 | pr_err("Failed for enable clock for %s\n", np->full_name); | 96 | pr_err("Failed for enable clock for %pOF\n", np); |
98 | goto out_clk_put; | 97 | goto out_clk_put; |
99 | } | 98 | } |
100 | 99 | ||
101 | of_clk->rate = clk_get_rate(of_clk->clk); | 100 | of_clk->rate = clk_get_rate(of_clk->clk); |
102 | if (!of_clk->rate) { | 101 | if (!of_clk->rate) { |
103 | ret = -EINVAL; | 102 | ret = -EINVAL; |
104 | pr_err("Failed to get clock rate for %s\n", np->full_name); | 103 | pr_err("Failed to get clock rate for %pOF\n", np); |
105 | goto out_clk_disable; | 104 | goto out_clk_disable; |
106 | } | 105 | } |
107 | 106 | ||
diff --git a/drivers/clocksource/timer-probe.c b/drivers/clocksource/timer-probe.c index da81e5de74fe..028075720334 100644 --- a/drivers/clocksource/timer-probe.c +++ b/drivers/clocksource/timer-probe.c | |||
@@ -40,8 +40,7 @@ void __init timer_probe(void) | |||
40 | 40 | ||
41 | ret = init_func_ret(np); | 41 | ret = init_func_ret(np); |
42 | if (ret) { | 42 | if (ret) { |
43 | pr_err("Failed to initialize '%s': %d\n", | 43 | pr_err("Failed to initialize '%pOF': %d\n", np, ret); |
44 | of_node_full_name(np), ret); | ||
45 | continue; | 44 | continue; |
46 | } | 45 | } |
47 | 46 | ||
diff --git a/drivers/clocksource/timer-stm32.c b/drivers/clocksource/timer-stm32.c index 174d1243ea93..8f2423789ba9 100644 --- a/drivers/clocksource/timer-stm32.c +++ b/drivers/clocksource/timer-stm32.c | |||
@@ -138,7 +138,7 @@ static int __init stm32_clockevent_init(struct device_node *np) | |||
138 | irq = irq_of_parse_and_map(np, 0); | 138 | irq = irq_of_parse_and_map(np, 0); |
139 | if (!irq) { | 139 | if (!irq) { |
140 | ret = -EINVAL; | 140 | ret = -EINVAL; |
141 | pr_err("%s: failed to get irq.\n", np->full_name); | 141 | pr_err("%pOF: failed to get irq.\n", np); |
142 | goto err_get_irq; | 142 | goto err_get_irq; |
143 | } | 143 | } |
144 | 144 | ||
@@ -168,12 +168,12 @@ static int __init stm32_clockevent_init(struct device_node *np) | |||
168 | ret = request_irq(irq, stm32_clock_event_handler, IRQF_TIMER, | 168 | ret = request_irq(irq, stm32_clock_event_handler, IRQF_TIMER, |
169 | "stm32 clockevent", data); | 169 | "stm32 clockevent", data); |
170 | if (ret) { | 170 | if (ret) { |
171 | pr_err("%s: failed to request irq.\n", np->full_name); | 171 | pr_err("%pOF: failed to request irq.\n", np); |
172 | goto err_get_irq; | 172 | goto err_get_irq; |
173 | } | 173 | } |
174 | 174 | ||
175 | pr_info("%s: STM32 clockevent driver initialized (%d bits)\n", | 175 | pr_info("%pOF: STM32 clockevent driver initialized (%d bits)\n", |
176 | np->full_name, bits); | 176 | np, bits); |
177 | 177 | ||
178 | return ret; | 178 | return ret; |
179 | 179 | ||