Skip to content

Commit

Permalink
clocksource/drivers/timer-of: Store the device node pointer in 'struc…
Browse files Browse the repository at this point in the history
…t timer_of'

Under certain circumstances, some specific operations must be done with the
device node pointer, which forces the timer code to propagate the pointer to
the functions which need it.

In order to consolidate the function signatures in the different drivers
by using the timer-of structure, let's store it in the timer-of structure
as a handy pointer when it is needed.

Tested-by: Benjamin Gaignard <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Acked-by: Benjamin Gaignard <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
dlezcano authored and Ingo Molnar committed Jan 8, 2018
1 parent 067bc91 commit 1c63c1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/clocksource/timer-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to)

if (!to->clkevt.name)
to->clkevt.name = np->name;

to->np = np;

return ret;

out_fail:
Expand Down
1 change: 1 addition & 0 deletions drivers/clocksource/timer-of.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct of_timer_clk {

struct timer_of {
unsigned int flags;
struct device_node *np;
struct clock_event_device clkevt;
struct of_timer_base of_base;
struct of_timer_irq of_irq;
Expand Down

0 comments on commit 1c63c1c

Please sign in to comment.