Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] The patch uses `pm_sleep_ptr()` for the `dev_pm_ops` structure pointer 
instead of `pm_ptr()`, violating PM subsystem guidelines.
--

--- Patch [1]: [PATCH] drm/mediatek: Convert to DEFINE_SIMPLE_DEV_PM_OPS() ---
commit 400d629fa164bd607d4a5ca22f02d2a6a8f25fe6
Author: Triet Hoang <[email protected]>

drm/mediatek: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

This commit replaces the deprecated SIMPLE_DEV_PM_OPS with
DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr(). It removes the __maybe_unused
annotations from the suspend and resume callbacks to reduce kernel size
when PM features are disabled.

> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c 
> b/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c
> index f0277fcf3345b..c1a12c5a0f905 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c
[ ... ]
> @@ -1511,7 +1511,7 @@ static struct platform_driver mtk_hdmi_v2_driver = {
>       .driver = {
>               .name = "mediatek-drm-hdmi-v2",
>               .of_match_table = mtk_drm_hdmi_v2_of_ids,
> -             .pm = &mtk_hdmi_v2_pm_ops,
> +             .pm = pm_sleep_ptr(&mtk_hdmi_v2_pm_ops),

[Severity: Low]
Should this use pm_ptr() instead of pm_sleep_ptr()?

According to power management guidelines, pm_sleep_ptr() evaluates to NULL
when CONFIG_PM_SLEEP is disabled. If runtime PM callbacks were ever added
to the dev_pm_ops structure in the future, wouldn't using pm_sleep_ptr()
here silently disable those runtime PM callbacks when system sleep is
disabled but CONFIG_PM is still enabled?

The standard pattern is to use pm_sleep_ptr() for the individual sleep
callbacks inside the structure definition, and pm_ptr() for the structure
pointer assignment itself.

>       },
>  };
>  module_platform_driver(mtk_hdmi_v2_driver);

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to