[PATCH v4 0/3] Fix build issue when CONFIG_MODULES is not set
From: Pratap Nirujogi
Date: Mon Jun 09 2025 - 11:56:47 EST
When CONFIG_MODULES is not defined, 'adap->owner->name' used in amd_isp4 platform
driver will not be valid and is resulting in build failures.
../drivers/platform/x86/amd/amd_isp4.c: In function 'is_isp_i2c_adapter':
../drivers/platform/x86/amd/amd_isp4.c:154:35: error: invalid use of undefined type 'struct module'
154 | return !strcmp(adap->owner->name, "i2c_designware_amdisp");
| ^~
To fix this issue, need to make changes both in platform and i2c driver modules.
* In the amd_isp4 x86/platform driver, replace 'adap->owner->name' with 'adap->name', this removes
the hard dependency on 'struct module'.
* In i2c amdisp driver, initialize unique name to i2c adapter and also make a change in
i2c-designware-common to avoid overwriting with generic name when adap->name[] is already set.
---
Changes v3 -> v4:
* Update MAINTAINERS file with the new isp4_misc.h added
* Fix typo error
Changes v2 -> v3:
* Update commit text for patch 1/3
Changes v1 -> v2:
* Replace snprintf with scnprintf
* Add new isp4 specific misc header file to include the adapter name
* Remove 'Fixes' and 'Link' tags from i2c patches
---
Pratap Nirujogi (3):
i2c: designware: Initialize adapter name only when not set
i2c: amd-isp: Initialize unique adapter name
platform/x86: Use i2c adapter name to fix build errors
MAINTAINERS | 1 +
drivers/i2c/busses/i2c-designware-amdisp.c | 2 ++
drivers/i2c/busses/i2c-designware-master.c | 5 +++--
drivers/platform/x86/amd/amd_isp4.c | 3 ++-
include/linux/soc/amd/isp4_misc.h | 12 ++++++++++++
5 files changed, 20 insertions(+), 3 deletions(-)
create mode 100644 include/linux/soc/amd/isp4_misc.h
--
2.43.0