Re: [PATCH v2] arch: consolidate pm_power_off callback
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: "Enrico Weigelt, metux IT consult" <info@xxxxxxxxx>
- Subject: Re: [PATCH v2] arch: consolidate pm_power_off callback
- From: Will Deacon <will@xxxxxxxxxx>
- Date: Tue, 12 Jan 2021 14:05:00 +0000
- Cc: linux-kernel@xxxxxxxxxxxxxxx, catalin.marinas@xxxxxxx, msalter@xxxxxxxxxx, jacquiot.aurelien@xxxxxxxxx, ysato@xxxxxxxxxxxxx, geert@xxxxxxxxxxxxxx, tsbogend@xxxxxxxxxxxxxxxx, ley.foon.tan@xxxxxxxxx, jonas@xxxxxxxxxxxx, stefan.kristiansson@xxxxxxxxxxxxx, shorne@xxxxxxxxx, James.Bottomley@xxxxxxxxxxxxxxxxxxxxx, deller@xxxxxx, benh@xxxxxxxxxxxxxxxxxxx, paulus@xxxxxxxxx, dalias@xxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, x86@xxxxxxxxxx, hpa@xxxxxxxxx, sstabellini@xxxxxxxxxx, chris@xxxxxxxxxx, jcmvbkbc@xxxxxxxxx, christian@xxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-c6x-dev@xxxxxxxxxxxxx, linux-csky@xxxxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, openrisc@xxxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx
- In-reply-to: <20201227140129.19932-1-info@metux.net>
- References: <20201227140129.19932-1-info@metux.net>
- User-agent: Mutt/1.10.1 (2018-07-13)
On Sun, Dec 27, 2020 at 03:01:28PM +0100, Enrico Weigelt, metux IT consult wrote:
> Move the pm_power_off callback into one global place and also add an
> function for conditionally calling it (when not NULL), in order to remove
> code duplication in all individual archs.
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Signed-off-by: Enrico Weigelt, metux IT consult <info@xxxxxxxxx>
[...]
> diff --git a/kernel/reboot.c b/kernel/reboot.c
> index eb1b15850761..ec4cd66dd1ae 100644
> --- a/kernel/reboot.c
> +++ b/kernel/reboot.c
> @@ -53,6 +53,16 @@ int reboot_force;
> void (*pm_power_off_prepare)(void);
> EXPORT_SYMBOL_GPL(pm_power_off_prepare);
>
> +void (*pm_power_off)(void);
> +EXPORT_SYMBOL_GPL(pm_power_off);
> +
> +void do_power_off(void)
> +{
> + if (pm_power_off)
> + pm_power_off();
> +}
> +EXPORT_SYMBOL_GPL(do_power_off);
Could this just live as a static inline in pm.h to avoid having to export
the extra symbol?
Will
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]