]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: samsung: acpm: remove compile-testing stubs
authorArnd Bergmann <arnd@arndb.de>
Fri, 29 May 2026 13:43:31 +0000 (15:43 +0200)
committerKrzysztof Kozlowski <krzk@kernel.org>
Fri, 29 May 2026 14:05:31 +0000 (16:05 +0200)
Sashiko reported an inconsistent use of NULL vs ERR_PTR()
returns in the stub helpers in xynos-acpm-protocol.h.

Since this only happens on dead code for COMPILE_TEST=y, this is not
really a bug though.  Having stub functions that return NULL is a common
way to define optional interfaces, where callers still work when the
feature is disabled, though this clearly does not work for acpm because
some callers have a NULL pointer dereference when compile testing.

Since CONFIG_EXYNOS_ACPM_PROTOCOL already supports compile-testing itself,
and all (both) drivers using it clearly require the support, so this
just simplifies the option space without losing any build coverage.

Remove the stub functions entirely and adjust the one Kconfig
dependency to require EXYNOS_ACPM_PROTOCOL unconditionally.

Fixes: 6837c006d4e7 ("firmware: exynos-acpm: add empty method to allow compile test")
Closes: https://sashiko.dev/#/patchset/20260420-acpm-tmu-v3-0-3dc8e93f0b26%40linaro.org
Link: https://lore.kernel.org/all/a7994860-24a3-4f87-84bf-109ed653dda4@linaro.org/
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260529134454.2147446-1-arnd@kernel.org
[krzk: Rebase on difference in devm_acpm_get_by_node()]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
drivers/clk/samsung/Kconfig
include/linux/firmware/samsung/exynos-acpm-protocol.h

index 70a8b82a0136b4d0213d8ff95e029c52436e5c7f..198d8b621289312f14f5f079af73a5745200a5bc 100644 (file)
@@ -97,7 +97,7 @@ config EXYNOS_CLKOUT
 
 config EXYNOS_ACPM_CLK
        tristate "Clock driver controlled via ACPM interface"
-       depends on EXYNOS_ACPM_PROTOCOL || (COMPILE_TEST && !EXYNOS_ACPM_PROTOCOL)
+       depends on EXYNOS_ACPM_PROTOCOL
        help
          This driver provides support for clocks that are controlled by
          firmware that implements the ACPM interface.
index dbf052c4139ba921ecc234e6c10bae3826eed1d8..c6b35c0ff300cb368696e1cb928fd160da0dc75f 100644 (file)
@@ -67,22 +67,8 @@ struct acpm_handle {
 
 struct device;
 
-#if IS_ENABLED(CONFIG_EXYNOS_ACPM_PROTOCOL)
 struct acpm_handle *devm_acpm_get_by_node(struct device *dev,
                                          struct device_node *np);
 struct acpm_handle *devm_acpm_get_by_phandle(struct device *dev);
-#else
-
-static inline struct acpm_handle *devm_acpm_get_by_node(struct device *dev,
-                                                       struct device_node *np)
-{
-       return NULL;
-}
-
-static inline struct acpm_handle *devm_acpm_get_by_phandle(struct device *dev)
-{
-       return ERR_PTR(-ENODEV);
-}
-#endif
 
 #endif /* __EXYNOS_ACPM_PROTOCOL_H */