Re: [PATCH] PM / devfreq: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

[email protected]
Newsgroups dev.linux.lists.linux-sunxi
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The drivers incorrectly use `pm_sleep_ptr()` instead of `pm_ptr()` for assigning the `dev_pm_ops` structure pointer to the driver's `.pm` field.
--

--- Patch [1]: [PATCH] PM / devfreq: Convert to DEFINE_SIMPLE_DEV_PM_OPS() ---
commit a6ee24f192dd2bca22b18dedee330c5384183db0
Author: Triet Hoang <[email protected]>

PM / devfreq: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

This commit converts the deprecated SIMPLE_DEV_PM_OPS to
DEFINE_SIMPLE_DEV_PM_OPS and drops __maybe_unused annotations. It also
updates the pm assignments to reduce kernel size when PM configs are
disabled.

> diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
> index dbdce7636ca5b..3ebc817fa6084 100644
> --- a/drivers/devfreq/rk3399_dmc.c
> +++ b/drivers/devfreq/rk3399_dmc.c
[ ... ]
> @@ -477,7 +477,7 @@ static struct platform_driver rk3399_dmcfreq_driver = {
>  	.remove = rk3399_dmcfreq_remove,
>  	.driver = {
>  		.name	= "rk3399-dmc-freq",
> -		.pm	= &rk3399_dmcfreq_pm,
> +		.pm	= pm_sleep_ptr(&rk3399_dmcfreq_pm),

[Severity: Low]
Should this use pm_ptr() instead of pm_sleep_ptr() for the structure pointer?
According to PM subsystem guidelines, pm_sleep_ptr() is intended for sleep
callbacks, while pm_ptr() should be used for the dev_pm_ops structure pointer
itself.

>  		.of_match_table = rk3399dmc_devfreq_of_match,
>  	},
>  };
> diff --git a/drivers/devfreq/sun8i-a33-mbus.c b/drivers/devfreq/sun8i-a33-mbus.c
> index 4bd5657558d6b..1636501c753ee 100644
> --- a/drivers/devfreq/sun8i-a33-mbus.c
> +++ b/drivers/devfreq/sun8i-a33-mbus.c
[ ... ]
> @@ -479,7 +479,7 @@ static struct platform_driver sun8i_a33_mbus_driver = {
>  	.driver	= {
>  		.name		= "sun8i-a33-mbus",
>  		.of_match_table	= sun8i_a33_mbus_of_match,
> -		.pm		= pm_ptr(&sun8i_a33_mbus_pm_ops),
> +		.pm		= pm_sleep_ptr(&sun8i_a33_mbus_pm_ops),

[Severity: Low]
Similar to the rk3399_dmc driver above, should this remain pm_ptr() for the
structure pointer instead of being changed to pm_sleep_ptr()?

>  	},
>  };

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.