lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGTfZH08WoMpBxw6JRsjobYsh-e1CAuddwp4j1DQOTTvAwtS=A@mail.gmail.com>
Date: Thu, 9 May 2024 00:42:50 +0900
From: Chanwoo Choi <chanwoo@...nel.org>
To: Anand Moon <linux.amoon@...il.com>
Cc: Chanwoo Choi <cw00.choi@...sung.com>, MyungJoo Ham <myungjoo.ham@...sung.com>, 
	Kyungmin Park <kyungmin.park@...sung.com>, Krzysztof Kozlowski <krzk@...nel.org>, 
	Alim Akhtar <alim.akhtar@...sung.com>, linux-pm@...r.kernel.org, 
	linux-samsung-soc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/2] PM / devfreq: exynos: Use DEFINE_SIMPLE_DEV_PM_OPS
 for PM functions

On Wed, Apr 17, 2024 at 1:45 PM Anand Moon <linux.amoon@...il.com> wrote:
>
> This macro has the advantage over SET_SYSTEM_SLEEP_PM_OPS that we don't
> have to care about when the functions are actually used.
>
> Also make use of pm_sleep_ptr() to discard all PM_SLEEP related
> stuff if CONFIG_PM_SLEEP isn't enabled.
>
> Signed-off-by: Anand Moon <linux.amoon@...il.com>
> ---
> v3: fix using new DEFINE_SIMPLE_DEV_PM_OPS PM macro hence
>     change the $subject and the commit message
>
> v2: add __maybe_unused to suspend/resume functions in case CONFIG_PM
>    is disabled
> ---
>  drivers/devfreq/exynos-bus.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index 153340b6685f..b89e04eb8430 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -454,7 +454,6 @@ static void exynos_bus_shutdown(struct platform_device *pdev)
>         devfreq_suspend_device(bus->devfreq);
>  }
>
> -#ifdef CONFIG_PM_SLEEP
>  static int exynos_bus_resume(struct device *dev)
>  {
>         struct exynos_bus *bus = dev_get_drvdata(dev);
> @@ -482,11 +481,9 @@ static int exynos_bus_suspend(struct device *dev)
>
>         return 0;
>  }
> -#endif
>
> -static const struct dev_pm_ops exynos_bus_pm = {
> -       SET_SYSTEM_SLEEP_PM_OPS(exynos_bus_suspend, exynos_bus_resume)
> -};
> +static DEFINE_SIMPLE_DEV_PM_OPS(exynos_bus_pm,
> +                               exynos_bus_suspend, exynos_bus_resume);
>
>  static const struct of_device_id exynos_bus_of_match[] = {
>         { .compatible = "samsung,exynos-bus", },
> @@ -499,7 +496,7 @@ static struct platform_driver exynos_bus_platdrv = {
>         .shutdown       = exynos_bus_shutdown,
>         .driver = {
>                 .name   = "exynos-bus",
> -               .pm     = &exynos_bus_pm,
> +               .pm     = pm_sleep_ptr(&exynos_bus_pm),
>                 .of_match_table = exynos_bus_of_match,
>         },
>  };
> --
> 2.44.0
>
>

Applied it. Thanks.

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ