[PATCH v2 1/1] i2c: amd-mp2-pci: Simplify PM code using DEFINE_RUNTIME_DEV_PM_OPS
From: Artem Shimko
Date: Mon Sep 08 2025 - 08:12:29 EST
Hello maintainers and reviewers,
Fix build errors when CONFIG_PM is disabled by:
Removing #ifdef CONFIG_PM guards around suspend/resume function
declarations in i2c-amd-mp2.h
Removing #ifdef CONFIG_PM guards around suspend/resume function
assignments in i2c-amd-mp2-plat.c
Keeping the suspend/resume function pointers defined but unused
when CONFIG_PM is disabled, as the common structure should have
consistent layout regardless of PM configuration
This change reduces preprocessor conditional complexity and ensures
better code elimination for non-PM configurations while maintaining
build correctness in all config scenarios.
Thank you for your consideration.
Best regards,
Artem Shimko
ChangeLog:
v2:
* Fixed build errors when CONFIG_PM is disabled by properly
handling suspend/resume function pointers in i2c-amd-mp2.h
and i2c-amd-mp2-plat.c
drivers/i2c/busses/i2c-amd-mp2.h | 4 +---
drivers/i2c/busses/i2c-amd-mp2-pci.c | 9 +++------
drivers/i2c/busses/i2c-amd-mp2-plat.c | 5 +----
3 files changed, 5 insertions(+), 13 deletions(-)
--
2.43.0