Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

reset: intel: Use devm_register_restart_handler()

Function register_restart_handler() is deprecated. Using this new API
removes our need to keep and manage a struct notifier_block and to
later unregister the handler.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

authored by

Andrew Davis and committed by
Philipp Zabel
8bfef0c2 59ad2fb0

+3 -8
+3 -8
drivers/reset/reset-intel-gw.c
··· 28 28 29 29 struct intel_reset_data { 30 30 struct reset_controller_dev rcdev; 31 - struct notifier_block restart_nb; 32 31 const struct intel_reset_soc *soc_data; 33 32 struct regmap *regmap; 34 33 struct device *dev; ··· 152 153 return id; 153 154 } 154 155 155 - static int intel_reset_restart_handler(struct notifier_block *nb, 156 - unsigned long action, void *data) 156 + static int intel_reset_restart_handler(struct sys_off_data *data) 157 157 { 158 - struct intel_reset_data *reset_data; 158 + struct intel_reset_data *reset_data = data->cb_data; 159 159 160 - reset_data = container_of(nb, struct intel_reset_data, restart_nb); 161 160 intel_assert_device(&reset_data->rcdev, reset_data->reboot_id); 162 161 163 162 return NOTIFY_DONE; ··· 212 215 if (data->soc_data->legacy) 213 216 data->reboot_id |= FIELD_PREP(STAT_BIT_OFFSET_MASK, rb_id[2]); 214 217 215 - data->restart_nb.notifier_call = intel_reset_restart_handler; 216 - data->restart_nb.priority = 128; 217 - register_restart_handler(&data->restart_nb); 218 + devm_register_restart_handler(&pdev->dev, intel_reset_restart_handler, data); 218 219 219 220 return 0; 220 221 }