diff options
author | Ovidiu Panait <ovpanait@gmail.com> | 2022-10-12 08:36:54 +0300 |
---|---|---|
committer | Michal Simek <michal.simek@amd.com> | 2022-11-22 15:02:07 +0100 |
commit | 1e766a04c723e003c001c0f1a4f301aef026a75e (patch) | |
tree | 7c8d9a613b2ffb556b23e5f56eaba5f25a8454c4 /include/timer.h | |
parent | ba74bcf3e07b10ffebf42e72a656b420215b5a2e (diff) | |
download | u-boot-1e766a04c723e003c001c0f1a4f301aef026a75e.tar.gz |
timer-uclass: add timer_get_ops() macro
Align timer uclass with the other subsystems and provide a timer_get_ops()
convenience macro.
Using this instead of the generic device_get_ops() also prevents
-Wdiscarded-qualifiers warnings when used with non-const variables.
Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20221012053656.1492457-1-ovpanait@gmail.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Diffstat (limited to 'include/timer.h')
-rw-r--r-- | include/timer.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/timer.h b/include/timer.h index a044cb034ed..d33a26e28fe 100644 --- a/include/timer.h +++ b/include/timer.h @@ -6,6 +6,8 @@ #ifndef _TIMER_H_ #define _TIMER_H_ +#define timer_get_ops(dev) ((struct timer_ops *)(dev)->driver->ops) + /** * dm_timer_init() - initialize a timer for time keeping. On success * initializes gd->timer so that lib/timer can use it for future |