From: Andy Yan Date: Thu, 8 Dec 2016 08:58:07 +0000 (+0800) Subject: power: reset: reboot-mode: treat unrecognized reboot mode as normal mode X-Git-Tag: firefly_0821_release~1117 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=20977374c5eb850180bcd163b9ef568ba0f88451;p=firefly-linux-kernel-4.4.55.git power: reset: reboot-mode: treat unrecognized reboot mode as normal mode Some bootloader will check the reboot mode to take different action, so we treat unrecognized reboot mode as normal mode to prevent the system run into abnormal case. Change-Id: I88063a5b41e4e645443229fa490b2b55db5ccf27 Signed-off-by: Andy Yan --- diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot-mode.c index 09f1bc353087..1afccd2300b1 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -57,6 +57,8 @@ static int reboot_mode_notify(struct notifier_block *this, reboot = container_of(this, struct reboot_mode_driver, reboot_notifier); magic = get_reboot_mode_magic(reboot, cmd); + if (!magic) + magic = get_reboot_mode_magic(reboot, NULL); if (magic) reboot->write(magic);