[RFC v2 11/20] dm: add event notification

Heinrich Schuchardt xypron.glpk at gmx.de
Sun Jan 2 10:41:41 CET 2022


On 12/10/21 07:49, AKASHI Takahiro wrote:
> From: Simon Glass <sjg at chromium.org>
>
> This is a draft implementation of event notification mechanism from Simon.
> Under this scheme, any U-Boot subsystem can register some kind of callback
> function to a particular event (more event types will be added later) and
> that function will be invoked once the event is fired.
>
> As a first user, UEFI subsystem makes use of PROBE and REMOVE events so
> that we will be able to automatically create/remove efi_disk objects
> relying on associated block devices (UCLASS_BLK).
>
> To run the test:
> ./u-boot -T -c "ut common test_event_probe"
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> [add REMOVE event; fix checkpatch warnings]
> Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>

This patch breaks building sandbox_spl_defconfig.

common/event.c: In function ‘event_register’:
common/event.c:29:39: error: ‘gd_t’ {aka ‘struct global_data’} has no
member named ‘event_state’
    29 |         struct event_state *state = gd->event_state;
       |                                       ^~
common/event.c: In function ‘event_notify’:
common/event.c:47:39: error: ‘gd_t’ {aka ‘struct global_data’} has no
member named ‘event_state’
    47 |         struct event_state *state = gd->event_state;
       |                                       ^~
common/event.c: At top level:
common/event.c:77:5: error: redefinition of ‘event_uninit’
    77 | int event_uninit(void)
       |     ^~~~~~~~~~~~
In file included from common/event.c:13:
include/event.h:94:19: note: previous definition of ‘event_uninit’ with
type ‘int(void)’
    94 | static inline int event_uninit(void)
       |                   ^~~~~~~~~~~~
common/event.c: In function ‘event_uninit’:
common/event.c:79:39: error: ‘gd_t’ {aka ‘struct global_data’} has no
member named ‘event_state’
    79 |         struct event_state *state = gd->event_state;
       |                                       ^~
common/event.c: At top level:
common/event.c:90:5: error: redefinition of ‘event_init’
    90 | int event_init(void)
       |     ^~~~~~~~~~
In file included from common/event.c:13:
include/event.h:99:19: note: previous definition of ‘event_init’ with
type ‘int(void)’
    99 | static inline int event_init(void)
       |                   ^~~~~~~~~~
common/event.c: In function ‘event_init’:
common/event.c:100:11: error: ‘gd_t’ {aka ‘struct global_data’} has no
member named ‘event_state’
   100 |         gd->event_state = state;
       |           ^~
make[2]: *** [scripts/Makefile.build:254: spl/common/event.o] Error 1
make[1]: *** [scripts/Makefile.spl:515: spl/common] Error 2
make[1]: *** Waiting for unfinished jobs....
   AR      spl/env/built-in.o
   AR      spl/common/spl/built-in.o
test/test-main.c: In function ‘test_pre_run’:
test/test-main.c:222:11: error: ‘gd_t’ {aka ‘struct global_data’} has no
member named ‘event_state’
   222 |         gd->event_state = NULL;
       |           ^~
make[2]: *** [scripts/Makefile.build:253: spl/test/test-main.o] Error 1
make[2]: *** Waiting for unfinished jobs....
   AR      spl/test/image/built-in.o
make[1]: *** [scripts/Makefile.spl:515: spl/test] Error 2
make: *** [Makefile:2086: spl/u-boot-spl] Error 2

Best regards

Heinrich


More information about the U-Boot mailing list