x86: sysreset: Separate out the EFI code
authorSimon Glass <sjg@chromium.org>
Thu, 2 May 2019 16:52:13 +0000 (10:52 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Wed, 8 May 2019 05:02:15 +0000 (13:02 +0800)
commit40476f4afc08ccb6f1f95d7790b6a29159e8b30a
tree25feac5a92d114d0bf0b58d1ad9717b5e258f9b5
parent2b36eabd8aec5107f4753715c2fb4e30cb0d6136
x86: sysreset: Separate out the EFI code

The EFI implementation of reset sits inside the driver and is called
directly from outside the driver, breaking the normal driver-model
conventions. Worse, it passed NULL as the device pointer, hoping that
the called function won't use it, which breaks as soon as code is added
to use it.

Separate out the implementation to improve the situation enough to allow
a future patch to add new sysreset features.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/sysreset/sysreset_x86.c