diff options
| author | Li Jun <lijun01@kylinos.cn> | 2026-09-09 16:24:59 +0800 |
|---|---|---|
| committer | Jarkko Sakkinen <jarkko@kernel.org> | 2026-10-23 00:59:21 +0300 |
| commit | 03f05257358dabb673ed21c64b0217442a55bfe2 (patch) | |
| tree | aa640b8e0e6c171842699b28e29ae04b63906210 /scripts/patch-kernel | |
| parent | fc0ddb3174b06800d8414d87e551eb60c36d1f38 (diff) | |
| download | linux-03f05257358dabb673ed21c64b0217442a55bfe2.tar.gz linux-03f05257358dabb673ed21c64b0217442a55bfe2.zip | |
tpm: use DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr()
Replace the deprecated SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
and wrap the struct assignment with pm_sleep_ptr(). The old code keeps
a completely empty dev_pm_ops structure -- all callbacks are NULL --
as dead code in the object file when CONFIG_PM_SLEEP=n, because
SET_SYSTEM_SLEEP_PM_OPS() expands to nothing while __maybe_unused on
the struct only silences the warning without removing the struct.
Switching to DEFINE_SIMPLE_DEV_PM_OPS() lets pm_sleep_ptr() eliminate
the callback references at compile time, and wrapping the struct
assignment with pm_sleep_ptr() drops the entire structure when
CONFIG_PM_SLEEP is disabled, instead of retaining an empty one.
Signed-off-by: Li Jun <lijun01@kylinos.cn>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20260909082459.796628-1-lijun01@kylinos.cn
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'scripts/patch-kernel')
0 files changed, 0 insertions, 0 deletions
