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: sunplus: Use devm_register_sys_off_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
9d93e13b 71c021cd

+4 -8
+4 -8
drivers/reset/reset-sunplus.c
··· 100 100 101 101 struct sp_reset { 102 102 struct reset_controller_dev rcdev; 103 - struct notifier_block notifier; 104 103 void __iomem *base; 105 104 }; 106 105 ··· 153 154 .status = sp_reset_status, 154 155 }; 155 156 156 - static int sp_restart(struct notifier_block *nb, unsigned long mode, 157 - void *cmd) 157 + static int sp_restart(struct sys_off_data *data) 158 158 { 159 - struct sp_reset *reset = container_of(nb, struct sp_reset, notifier); 159 + struct sp_reset *reset = data->cb_data; 160 160 161 161 sp_reset_assert(&reset->rcdev, 0); 162 162 sp_reset_deassert(&reset->rcdev, 0); ··· 187 189 if (ret) 188 190 return ret; 189 191 190 - reset->notifier.notifier_call = sp_restart; 191 - reset->notifier.priority = 192; 192 - 193 - return register_restart_handler(&reset->notifier); 192 + return devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART, 193 + 192, sp_restart, reset); 194 194 } 195 195 196 196 static const struct of_device_id sp_reset_dt_ids[] = {