[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZeWSp4ohOhHGclud@hovoldconsulting.com>
Date: Mon, 4 Mar 2024 10:21:43 +0100
From: Johan Hovold <johan@...nel.org>
To: Anand Moon <linux.amoon@...il.com>
Cc: Alan Stern <stern@...land.harvard.edu>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Alim Akhtar <alim.akhtar@...sung.com>, linux-usb@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/4] usb: ehci-exynos: Switch from CONFIG_PM guards to
pm_ptr()
On Sat, Mar 02, 2024 at 01:08:09AM +0530, Anand Moon wrote:
> Use the new PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM are disabled,
> without having to use #ifdef guards. If CONFIG_PM unused,
> they will simply be discarded by the compiler.
>
> Use RUNTIME_PM_OPS runtime macro for suspend/resume function.
>
> Signed-off-by: Anand Moon <linux.amoon@...il.com>
> ---
> drivers/usb/host/ehci-exynos.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
> static const struct dev_pm_ops exynos_ehci_pm_ops = {
> - .suspend = exynos_ehci_suspend,
> - .resume = exynos_ehci_resume,
> + RUNTIME_PM_OPS(exynos_ehci_suspend, exynos_ehci_resume, NULL)
> };
This is also broken and clearly not tested. See the definition of
RUNTIME_PM_OPS() which sets the runtime pm callbacks, not the suspend
ones:
#define RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
.runtime_suspend = suspend_fn, \
.runtime_resume = resume_fn, \
.runtime_idle = idle_fn,
Johan
Powered by blists - more mailing lists