aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-15 14:15:42 -0700
committerTom Rini <trini@konsulko.com>2023-02-11 11:08:34 -0500
commit7e6c92cb744c7d6b2d198fef43afda546cf8f83f (patch)
treef92af5bca5d41935f89bb7d2c3dc7a384882ac15
parent704971ac3d1fb0c70c9676cbaca27b248d419164 (diff)
downloadu-boot-7e6c92cb744c7d6b2d198fef43afda546cf8f83f.zip
u-boot-7e6c92cb744c7d6b2d198fef43afda546cf8f83f.tar.gz
u-boot-7e6c92cb744c7d6b2d198fef43afda546cf8f83f.tar.bz2
timer: Tidy up use of notrace
Tracing is typically enabled by the time driver model starts up, so there is no point in adding a 'notrace' to the timer-init function. However, once the driver model timer is enabled, we do need to be able to access the timer's private data when reading the timer, so add it to the core function needed for that. Update the function's documentation while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--drivers/core/device.c3
-rw-r--r--drivers/timer/timer-uclass.c2
-rw-r--r--include/timer.h13
3 files changed, 12 insertions, 6 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index d9ce546..6e26b64 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -654,7 +654,8 @@ void *dev_get_priv(const struct udevice *dev)
return dm_priv_to_rw(dev->priv_);
}
-void *dev_get_uclass_priv(const struct udevice *dev)
+/* notrace is needed as this is called by timer_get_rate() */
+notrace void *dev_get_uclass_priv(const struct udevice *dev)
{
if (!dev) {
dm_warn("%s: null device\n", __func__);
diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c
index bb71979..f4b871a 100644
--- a/drivers/timer/timer-uclass.c
+++ b/drivers/timer/timer-uclass.c
@@ -136,7 +136,7 @@ u64 timer_conv_64(u32 count)
return ((u64)gd->timebase_h << 32) | gd->timebase_l;
}
-int notrace dm_timer_init(void)
+int dm_timer_init(void)
{
struct udevice *dev = NULL;
__maybe_unused ofnode node;
diff --git a/include/timer.h b/include/timer.h
index d33a26e..311ce6b 100644
--- a/include/timer.h
+++ b/include/timer.h
@@ -9,11 +9,16 @@
#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
- * referrence.
+ * dm_timer_init() - set up a timer for time keeping
*
- * Return: 0 on success or error number
+ * Sets up gd->timer if the device is not already bound, making sure it is
+ * probed and ready for use
+ *
+ * On success, inits gd->timer so that lib/timer can use it for future reference
+ *
+ * Returns: 0 on success, -EAGAIN if driver model is not ready yet, -ENODEV if
+ * no timer could be found, other error if the timer could not be bound or
+ * probed
*/
int dm_timer_init(void);