From 60350ce1b5b19143f7872b03ed9e0858dfd543fe Mon Sep 17 00:00:00 2001 From: zhaoxp3 Date: Fri, 19 Apr 2019 09:50:18 +0800 Subject: [PATCH] power: use orderly shutdown User an orderly shutdown for factory kill instead of a kernel power off. The orderly shutdown will attempt to call the reboot binary from userspace first, and then fallback to kernel power off if it fails. Change-Id: Ia05f1c9e1ca25b403a4c5507da2d61d267e67def Signed-off-by: zhaoxp3 Reviewed-on: https://gerrit.mot.com/1339132 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Wei Xu Submit-Approved: Jira Key --- drivers/power/supply/s2mu00x_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/s2mu00x_battery.c b/drivers/power/supply/s2mu00x_battery.c index 5c5b355e78c6..866b19b688bb 100644 --- a/drivers/power/supply/s2mu00x_battery.c +++ b/drivers/power/supply/s2mu00x_battery.c @@ -4281,7 +4281,7 @@ void factory_usb_shutdown(struct s2mu00x_battery_info *chip) if (chip->factory_cable) { if (!factory_kill_disable) { printk(KERN_ERR "SMB - Factory Cable removed, power-off\n"); - kernel_power_off(); + orderly_poweroff(true); } else pr_err("SMB - Factory cable removed - kill disabled\n"); chip->factory_cable = false; -- 2.20.1