diff --git a/arch/arm/kernel/reboot.c b/arch/arm/kernel/reboot.c index 438fa4d525c7..47761ff99155 100644 --- a/arch/arm/kernel/reboot.c +++ b/arch/arm/kernel/reboot.c @@ -141,7 +141,7 @@ void machine_restart(char *cmd) local_irq_disable(); smp_send_stop(); - do_kernel_i2c_restart(cmd); + do_kernel_pre_restart(cmd); if (arm_pm_restart) arm_pm_restart(reboot_mode, cmd); diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index ddf146066d70..da9a4bcbe249 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -164,7 +164,7 @@ void machine_restart(char *cmd) local_irq_disable(); smp_send_stop(); - do_kernel_i2c_restart(cmd); + do_kernel_pre_restart(cmd); /* * UpdateCapsule() depends on the system being reset via diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index b8a51e006497..87f7aba54384 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -1315,7 +1315,7 @@ static int rk3x_i2c_probe(struct platform_device *pdev) i2c->i2c_restart_nb.notifier_call = rk3x_i2c_restart_notify; i2c->i2c_restart_nb.priority = 128; - ret = register_i2c_restart_handler(&i2c->i2c_restart_nb); + ret = register_pre_restart_handler(&i2c->i2c_restart_nb); if (ret) { dev_err(&pdev->dev, "failed to setup i2c restart handler.\n"); return ret; @@ -1446,7 +1446,7 @@ static int rk3x_i2c_remove(struct platform_device *pdev) i2c_del_adapter(&i2c->adap); clk_notifier_unregister(i2c->clk, &i2c->clk_rate_nb); - unregister_i2c_restart_handler(&i2c->i2c_restart_nb); + unregister_pre_restart_handler(&i2c->i2c_restart_nb); clk_unprepare(i2c->pclk); clk_unprepare(i2c->clk); diff --git a/include/linux/reboot.h b/include/linux/reboot.h index d85507e1fd7c..64036b953b18 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h @@ -49,9 +49,9 @@ extern int register_restart_handler(struct notifier_block *); extern int unregister_restart_handler(struct notifier_block *); extern void do_kernel_restart(char *cmd); -extern int register_i2c_restart_handler(struct notifier_block *); -extern int unregister_i2c_restart_handler(struct notifier_block *); -extern void do_kernel_i2c_restart(char *cmd); +extern int register_pre_restart_handler(struct notifier_block *); +extern int unregister_pre_restart_handler(struct notifier_block *); +extern void do_kernel_pre_restart(char *cmd); /* * Architecture-specific implementations of sys_reboot commands. diff --git a/kernel/reboot.c b/kernel/reboot.c index e9ee544d8ace..24bee9634183 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -213,23 +213,23 @@ void do_kernel_restart(char *cmd) atomic_notifier_call_chain(&restart_handler_list, reboot_mode, cmd); } -static ATOMIC_NOTIFIER_HEAD(i2c_restart_handler_list); +static ATOMIC_NOTIFIER_HEAD(pre_restart_handler_list); -int register_i2c_restart_handler(struct notifier_block *nb) +int register_pre_restart_handler(struct notifier_block *nb) { - return atomic_notifier_chain_register(&i2c_restart_handler_list, nb); + return atomic_notifier_chain_register(&pre_restart_handler_list, nb); } -EXPORT_SYMBOL(register_i2c_restart_handler); +EXPORT_SYMBOL(register_pre_restart_handler); -int unregister_i2c_restart_handler(struct notifier_block *nb) +int unregister_pre_restart_handler(struct notifier_block *nb) { - return atomic_notifier_chain_unregister(&i2c_restart_handler_list, nb); + return atomic_notifier_chain_unregister(&pre_restart_handler_list, nb); } -EXPORT_SYMBOL(unregister_i2c_restart_handler); +EXPORT_SYMBOL(unregister_pre_restart_handler); -void do_kernel_i2c_restart(char *cmd) +void do_kernel_pre_restart(char *cmd) { - atomic_notifier_call_chain(&i2c_restart_handler_list, reboot_mode, cmd); + atomic_notifier_call_chain(&pre_restart_handler_list, reboot_mode, cmd); } void migrate_to_reboot_cpu(void)