Skip to content

Commit

Permalink
clocksource/drivers/timer-of: Don't request the resource by name
Browse files Browse the repository at this point in the history
When the driver does not specify a name for the resource, don't use
of_io_request_and_map() but of_iomap(). That prevents resource name allocation
conflicts on some platforms which have the same name as the node.

Tested-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1515418139-23276-10-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Daniel Lezcano authored and Ingo Molnar committed Jan 8, 2018
1 parent 1c63c1c commit 9aea417
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/clocksource/timer-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ static __init void timer_of_base_exit(struct of_timer_base *of_base)
static __init int timer_of_base_init(struct device_node *np,
struct of_timer_base *of_base)
{
const char *name = of_base->name ? of_base->name : np->full_name;

of_base->base = of_io_request_and_map(np, of_base->index, name);
of_base->base = of_base->name ?
of_io_request_and_map(np, of_base->index, of_base->name) :
of_iomap(np, of_base->index);
if (IS_ERR(of_base->base)) {
pr_err("Failed to iomap (%s)\n", name);
pr_err("Failed to iomap (%s)\n", of_base->name);
return PTR_ERR(of_base->base);
}

Expand Down

0 comments on commit 9aea417

Please sign in to comment.