-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
riscv: cleanup the default power off implementation
Move the sbi poweroff to a separate function and file that is only compiled if CONFIG_SBI is set. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Anup Patel <anup@brainfault.org> Reviewed-by: Atish Patra <atish.patra@wdc.com> [paul.walmsley@sifive.com: split the WFI fix into a separate patch] Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
- Loading branch information
Christoph Hellwig
authored and
Paul Walmsley
committed
Nov 13, 2019
1 parent
3b03ac6
commit 3320648
Showing
3 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
#include <linux/init.h> | ||
#include <linux/pm.h> | ||
#include <asm/sbi.h> | ||
|
||
static void sbi_power_off(void) | ||
{ | ||
sbi_shutdown(); | ||
} | ||
|
||
static int __init sbi_init(void) | ||
{ | ||
pm_power_off = sbi_power_off; | ||
return 0; | ||
} | ||
early_initcall(sbi_init); |