power: reset: reboot-mode: treat unrecognized reboot mode as normal mode
authorAndy Yan <andy.yan@rock-chips.com>
Thu, 8 Dec 2016 08:58:07 +0000 (16:58 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 9 Dec 2016 02:32:09 +0000 (10:32 +0800)
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 <andy.yan@rock-chips.com>
drivers/power/reset/reboot-mode.c

index 09f1bc353087e6839a8c4a85dee58bd9e9f79ce6..1afccd2300b1031fe234ed672fad43d3313e8e00 100644 (file)
@@ -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);