commit ddfd9dcf270c ("ACPI: PM: Add acpi_[un]register_wakeup_handler()")
added new functions for drivers to use during the s2idle wakeup path, but
didn't add stubs for when CONFIG_ACPI wasn't set.
Add those stubs in for other drivers to be able to use.
Fixes: ddfd9dcf270c ("ACPI: PM: Add acpi_[un]register_wakeup_handler()")
Signed-off-by: Mario Limonciello <[email protected]>
---
include/linux/acpi.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 72e4f7fd268c..b31bcc0f4c89 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -976,6 +976,14 @@ static inline int acpi_get_local_address(acpi_handle handle, u32 *addr)
return -ENODEV;
}
+static inline int acpi_register_wakeup_handler(
+ int wake_irq, bool (*wakeup)(void *context), void *context)
+{
+ return -EINVAL;
+}
+static inline void acpi_unregister_wakeup_handler(
+ bool (*wakeup)(void *context), void *context) { }
+
#endif /* !CONFIG_ACPI */
#ifdef CONFIG_ACPI_HOTPLUG_IOAPIC
--
2.25.1
CC: linux-acpi
On Tuesday, October 19, 2021 6:04:00 PM CEST Mario Limonciello wrote:
> commit ddfd9dcf270c ("ACPI: PM: Add acpi_[un]register_wakeup_handler()")
> added new functions for drivers to use during the s2idle wakeup path, but
> didn't add stubs for when CONFIG_ACPI wasn't set.
>
> Add those stubs in for other drivers to be able to use.
>
> Fixes: ddfd9dcf270c ("ACPI: PM: Add acpi_[un]register_wakeup_handler()")
> Signed-off-by: Mario Limonciello <[email protected]>
> ---
> include/linux/acpi.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 72e4f7fd268c..b31bcc0f4c89 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -976,6 +976,14 @@ static inline int acpi_get_local_address(acpi_handle handle, u32 *addr)
> return -ENODEV;
> }
>
> +static inline int acpi_register_wakeup_handler(
> + int wake_irq, bool (*wakeup)(void *context), void *context)
> +{
> + return -EINVAL;
-ENOTSUPP ?
> +}
> +static inline void acpi_unregister_wakeup_handler(
> + bool (*wakeup)(void *context), void *context) { }
> +
> #endif /* !CONFIG_ACPI */
>
> #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC
>
On Tue, Oct 19, 2021 at 7:05 PM Mario Limonciello
<[email protected]> wrote:
Thanks! My comments below.
> commit ddfd9dcf270c ("ACPI: PM: Add acpi_[un]register_wakeup_handler()")
The commit
> added new functions for drivers to use during the s2idle wakeup path, but
> didn't add stubs for when CONFIG_ACPI wasn't set.
>
> Add those stubs in for other drivers to be able to use.
...
> +static inline int acpi_register_wakeup_handler(
> + int wake_irq, bool (*wakeup)(void *context), void *context)
A bit of a strange indentation. Can wake_irq be on the previous line?
--
With Best Regards,
Andy Shevchenko
[Public]
> -----Original Message-----
> From: Rafael J. Wysocki <[email protected]>
> Sent: Friday, October 22, 2021 07:54
> To: Limonciello, Mario <[email protected]>
> Cc: Linus Walleij <[email protected]>; Natikar, Basavaraj
> <[email protected]>; S-k, Shyam-sundar <Shyam-sundar.S-
> [email protected]>; open list:PIN CONTROL SUBSYSTEM <linux-
> [email protected]>; open list <[email protected]>; Shah, Nehal-
> bakulchandra <[email protected]>; Limonciello, Mario
> <[email protected]>; Linux ACPI <[email protected]>
> Subject: Re: [PATCH v3 1/2] ACPI: Add stubs for wakeup handler functions
>
> CC: linux-acpi
>
> On Tuesday, October 19, 2021 6:04:00 PM CEST Mario Limonciello wrote:
> > commit ddfd9dcf270c ("ACPI: PM: Add acpi_[un]register_wakeup_handler()")
> > added new functions for drivers to use during the s2idle wakeup path, but
> > didn't add stubs for when CONFIG_ACPI wasn't set.
> >
> > Add those stubs in for other drivers to be able to use.
> >
> > Fixes: ddfd9dcf270c ("ACPI: PM: Add acpi_[un]register_wakeup_handler()")
> > Signed-off-by: Mario Limonciello <[email protected]>
> > ---
> > include/linux/acpi.h | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> > index 72e4f7fd268c..b31bcc0f4c89 100644
> > --- a/include/linux/acpi.h
> > +++ b/include/linux/acpi.h
> > @@ -976,6 +976,14 @@ static inline int acpi_get_local_address(acpi_handle
> handle, u32 *addr)
> > return -ENODEV;
> > }
> >
> > +static inline int acpi_register_wakeup_handler(
> > + int wake_irq, bool (*wakeup)(void *context), void *context)
> > +{
> > + return -EINVAL;
>
> -ENOTSUPP ?
>
checkpatch reports:
WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
So what to use?
> > +}
> > +static inline void acpi_unregister_wakeup_handler(
> > + bool (*wakeup)(void *context), void *context) { }
> > +
> > #endif /* !CONFIG_ACPI */
> >
> > #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC
> >
>
>
>