From: Paul Cercueil <paul@crapouillou.net>
To: Hesham Almatary <hesham.almatary@huawei.com>
Cc: linux-kernel@vger.kernel.org, linuxarm@huawei.com,
jonathan.cameron@huawei.com, rafael@kernel.org, amitk@kernel.org,
rui.zhang@intel.com, linux-pm@vger.kernel.org
Subject: Re: [PATCH] thermal:hisi_termal: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
Date: Thu, 24 Mar 2022 12:11:29 +0000 [thread overview]
Message-ID: <5J099R.20GRUWFVWC5D1@crapouillou.net> (raw)
In-Reply-To: <20220324103443.4563-1-hesham.almatary@huawei.com>
Hi Hesham,
Le jeu., mars 24 2022 at 10:34:43 +0000, Hesham Almatary
<hesham.almatary@huawei.com> a écrit :
> Cleaning up the driver to use pm_sleep_ptr() macro instead of #ifdef
> guards is simpler and allows the compiler to remove those functions
> if built without CONFIG_PM_SLEEP support.
>
> Signed-off-by: Hesham Almatary <hesham.almatary@huawei.com>
Looks good.
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Cheers,
-Paul
> ---
> drivers/thermal/hisi_thermal.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/hisi_thermal.c
> b/drivers/thermal/hisi_thermal.c
> index 9a21ac0ceb11..b29ab09040d5 100644
> --- a/drivers/thermal/hisi_thermal.c
> +++ b/drivers/thermal/hisi_thermal.c
> @@ -629,7 +629,6 @@ static int hisi_thermal_remove(struct
> platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM_SLEEP
> static int hisi_thermal_suspend(struct device *dev)
> {
> struct hisi_thermal_data *data = dev_get_drvdata(dev);
> @@ -651,15 +650,14 @@ static int hisi_thermal_resume(struct device
> *dev)
>
> return ret;
> }
> -#endif
>
> -static SIMPLE_DEV_PM_OPS(hisi_thermal_pm_ops,
> +static DEFINE_SIMPLE_DEV_PM_OPS(hisi_thermal_pm_ops,
> hisi_thermal_suspend, hisi_thermal_resume);
>
> static struct platform_driver hisi_thermal_driver = {
> .driver = {
> .name = "hisi_thermal",
> - .pm = &hisi_thermal_pm_ops,
> + .pm = pm_sleep_ptr(&hisi_thermal_pm_ops),
> .of_match_table = of_hisi_thermal_match,
> },
> .probe = hisi_thermal_probe,
> --
> 2.25.1
>
next prev parent reply other threads:[~2022-03-24 12:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 10:34 [PATCH] thermal:hisi_termal: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Hesham Almatary
2022-03-24 12:11 ` Paul Cercueil [this message]
2022-04-13 14:38 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5J099R.20GRUWFVWC5D1@crapouillou.net \
--to=paul@crapouillou.net \
--cc=amitk@kernel.org \
--cc=hesham.almatary@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.