Reputation: 2755
So if I use like:
.............................
enum hrtimer_restart my_hrtimer_callback( struct hrtimer *timer )
.............................
hr_timer.function = &my_hrtimer_callback;
...............................
hrtimer_start(hr_timer,ktime,HRTIMER_MODE_REL);
...............................
Is it possible to pass any parameters to the callback function during the start of the timer? I google a little bit but didn't find a clue. How to use that?
Thanks;>
Upvotes: 3
Views: 2363
Reputation: 231443
Embed the struct hrtimer
in a structure of your creation that has any additional information you may need. Then use container_of()
to get the pointer to the containing structure from the timer
argument.
Upvotes: 6