Skip to content

Commit d755823

Browse files
MrVangregkh
authored andcommitted
firmware: imx: Add stub functions for SCMI MISC API
[ Upstream commit b2461e2 ] To ensure successful builds when CONFIG_IMX_SCMI_MISC_DRV is not enabled, this patch adds static inline stub implementations for the following functions: - scmi_imx_misc_ctrl_get() - scmi_imx_misc_ctrl_set() These stubs return -EOPNOTSUPP to indicate that the functionality is not supported in the current configuration. This avoids potential build or link errors in code that conditionally calls these functions based on feature availability. This patch also drops the changes in commit 540c830 ("firmware: imx: remove duplicate scmi_imx_misc_ctrl_get()"). The original change aimed to simplify the handling of optional features by removing conditional stubs. However, the use of conditional stubs is necessary when CONFIG_IMX_SCMI_MISC_DRV is n, while consumer driver is set to y. This is not a matter of preserving legacy patterns, but rather to ensure that there is no link error whether for module or built-in. Fixes: 0b4f8a6 ("firmware: imx: Add i.MX95 MISC driver") Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent edeae8b commit d755823

File tree

1 file changed

+12
-0
lines changed
  • include/linux/firmware/imx

1 file changed

+12
-0
lines changed

include/linux/firmware/imx/sm.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,19 @@
1717
#define SCMI_IMX_CTRL_SAI4_MCLK 4 /* WAKE SAI4 MCLK */
1818
#define SCMI_IMX_CTRL_SAI5_MCLK 5 /* WAKE SAI5 MCLK */
1919

20+
#if IS_ENABLED(CONFIG_IMX_SCMI_MISC_DRV)
2021
int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val);
2122
int scmi_imx_misc_ctrl_set(u32 id, u32 val);
23+
#else
24+
static inline int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val)
25+
{
26+
return -EOPNOTSUPP;
27+
}
28+
29+
static inline int scmi_imx_misc_ctrl_set(u32 id, u32 val)
30+
{
31+
return -EOPNOTSUPP;
32+
}
33+
#endif
2234

2335
#endif

0 commit comments

Comments
 (0)