History

kernel/reboot: Add devm_register_restart_handler()

Add devm_register_restart_handler() helper that registers sys-off handler using restart mode and with a default priority. Most drivers will want to register restart handler with a default priority, so this helper will reduce the boilerplate code and make code easier to read and follow.

Dmitry Osipenko committed 4 years ago

Commit 6779db91 parent d2c54152 files · +26 −0Browse files

Showing the changes to include (1 of 2 files). Show all

Unified · Split

include/linux/reboot.h+4−0
@@ -145,6 +145,10 @@ int devm_register_power_off_handler(struct device *dev, · 144 unmodified lines
145145 int (*callback)(struct sys_off_data *data),
146146 void *cb_data);
147147
148+int devm_register_restart_handler(struct device *dev,
149+ int (*callback)(struct sys_off_data *data),
150+ void *cb_data);
151+
148152 int register_platform_power_off(void (*power_off)(void));
149153 void unregister_platform_power_off(void (*power_off)(void));
150154