Re: [PATCH v7 04/20] kernel: Add combined power-off+restart handler call chain API

Dmitry Osipenko
2022-05-06T15:10:51Z

On 4/20/22 21:47, Rafael J. Wysocki wrote:
>>>> + void (*platform_power_off_cb)(void);
>>>> + void (*simple_power_off_cb)(void *data);
>>>> + void *simple_power_off_cb_data;
>>> Is there any particular reason to put these callbacks here and not
>>> directly into struct sys_off_handler?
>> They are used internally by reboot.c and shouldn't be touched by the
>> kernel API users, so I wanted to factor out and protect all the private
>> data.
> But they come from these users anyway, don't they?
>

Yes, the point is that these callback pointers are owned by the kernel
core while callbacks are registered.

--
Best regards,
Dmitry