summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-06-16 09:10:13 -0600
committerTom Rini <trini@konsulko.com>2024-06-16 09:10:13 -0600
commite242cd95130b64cf91692da41363ac59b25fc08d (patch)
treeb3b167faa221aff7adf419741acbc0c1e39833a6 /cmd
parentd8c213c9c7f827a9de0096bb4e5247c9a07bb248 (diff)
parent85c476759a42dfedb2d66e9734f8c05b7cfb62d5 (diff)
downloadu-boot-e242cd95130b64cf91692da41363ac59b25fc08d.tar.gz
u-boot-e242cd95130b64cf91692da41363ac59b25fc08d.tar.bz2
u-boot-e242cd95130b64cf91692da41363ac59b25fc08d.zip
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-watchdog into next
- misc cyclic infrastructure improvements (Rasmus) - watchdog_reset cleanup (Rasmus) CI: https://dev.azure.com/sr0718/u-boot/_build/results?buildId=369&view=results
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cyclic.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/cmd/cyclic.c b/cmd/cyclic.c
index 40e966de9a..339dd4a7bc 100644
--- a/cmd/cyclic.c
+++ b/cmd/cyclic.c
@@ -15,14 +15,16 @@
#include <time.h>
#include <vsprintf.h>
#include <linux/delay.h>
+#include <linux/kernel.h>
struct cyclic_demo_info {
+ struct cyclic_info cyclic;
uint delay_us;
};
-static void cyclic_demo(void *ctx)
+static void cyclic_demo(struct cyclic_info *c)
{
- struct cyclic_demo_info *info = ctx;
+ struct cyclic_demo_info *info = container_of(c, struct cyclic_demo_info, cyclic);
/* Just a small dummy delay here */
udelay(info->delay_us);
@@ -32,7 +34,6 @@ static int do_cyclic_demo(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
struct cyclic_demo_info *info;
- struct cyclic_info *cyclic;
uint time_ms;
if (argc < 3)
@@ -48,10 +49,7 @@ static int do_cyclic_demo(struct cmd_tbl *cmdtp, int flag, int argc,
info->delay_us = simple_strtoul(argv[2], NULL, 0);
/* Register demo cyclic function */
- cyclic = cyclic_register(cyclic_demo, time_ms * 1000, "cyclic_demo",
- info);
- if (!cyclic)
- printf("Registering of cyclic_demo failed\n");
+ cyclic_register(&info->cyclic, cyclic_demo, time_ms * 1000, "cyclic_demo");
printf("Registered function \"%s\" to be executed all %dms\n",
"cyclic_demo", time_ms);