[RFC 2/2] clocksource: arm_global_timer: Convert driver to use clocksource context field
eagle.alexander923 at gmail.com
Fri Jun 10 02:53:28 PDT 2022
пт, 10 июн. 2022 г. в 12:40, Sascha Hauer <sha at pengutronix.de>:
> On Fri, Jun 10, 2022 at 11:56:32AM +0300, Alexander Shiyan wrote:
> > Signed-off-by: Alexander Shiyan <eagle.alexander923 at gmail.com>
> > ---
> > drivers/clocksource/arm_global_timer.c | 27 +++++++++++++++-----------
> > 1 file changed, 16 insertions(+), 11 deletions(-)
> > diff --git a/drivers/clocksource/arm_global_timer.c b/drivers/clocksource/arm_global_timer.c
> > index 6e2fae9ba4..3e9b90059a 100644
> > --- a/drivers/clocksource/arm_global_timer.c
> > +++ b/drivers/clocksource/arm_global_timer.c
> As long as the statically allocated &cs is used it's not really useful
> to store the context pointer in there.
The meaning here is: With a static clocksource structure, the "ctx" field will
be initialized, so it will not allow a second instance of the driver to be
loaded (in case of incorrect DTS or something similar).
So. this example is just a single instance protector :)
I will review the code to understand how to make it easier.
More information about the barebox