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

From: Dmitry Osipenko
Date: Fri May 06 2022 - 11:10:54 EST


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