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.
Showing the changes to include (1 of 2 files). Show all
Unified · Split
| @@ -145,6 +145,10 @@ int devm_register_power_off_handler(struct device *dev, · 144 unmodified lines | ||
| 145 | 145 | int (*callback)(struct sys_off_data *data), |
| 146 | 146 | void *cb_data); |
| 147 | 147 | |
| 148 | +int devm_register_restart_handler(struct device *dev, | |
| 149 | + int (*callback)(struct sys_off_data *data), | |
| 150 | + void *cb_data); | |
| 151 | + | |
| 148 | 152 | int register_platform_power_off(void (*power_off)(void)); |
| 149 | 153 | void unregister_platform_power_off(void (*power_off)(void)); |
| 150 | 154 | |