Skip to contentSkip to conversation

of: move dummy of_device_get_match_data() helper

PATCH In review Arnd Bergmann 2 participants 2 messages Apr 13, 2023 – Apr 18, 2023 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of: move dummy of_device_get_match_data() helper

From: Arnd Bergmann <[email protected]>

The previous patch only moved the regular declaration but missed the inline function that is used with CONFIG_OF=n:

drivers/tty/serial/samsung_tty.c:2034:10: error: implicit declaration of function 'of_device_get_match_data' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

Fixes f5a2dc751657 ("of: Move of_device_get_match_data() declaration")
---
 include/linux/of.h        | 5 +++++
 include/linux/of_device.h | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
include/linux/of.h +5 -0
index f94f9e6476c0..c0d1512f979a 100644
@@ -815,6 +815,11 @@ static inline bool of_console_check(const struct device_node *dn, const char *na
 	return false;
 }
 
+static inline const void *of_device_get_match_data(const struct device *dev)
+{
+	return NULL;
+}
+
 static inline const __be32 *of_prop_next_u32(struct property *prop,
 		const __be32 *cur, u32 *pu)
 {
include/linux/of_device.h +0 -5
index 455c51a09091..2c7a3d4bc775 100644
@@ -51,11 +51,6 @@ static inline int of_driver_match_device(struct device *dev,
 static inline void of_device_uevent(const struct device *dev,
 			struct kobj_uevent_env *env) { }
 
-static inline const void *of_device_get_match_data(const struct device *dev)
-{
-	return NULL;
-}
-
 static inline int of_device_modalias(struct device *dev,
 				     char *str, ssize_t len)
 {
Signature · 1 line
2.39.2
#1 lore raw
Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The previous patch only moved the regular declaration but missed the inline function that is used with CONFIG_OF=n:

drivers/tty/serial/samsung_tty.c:2034:10: error: implicit declaration of function 'of_device_get_match_data' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

Fixes f5a2dc751657 ("of: Move of_device_get_match_data() declaration")

Despite multiple reports and having fixed it, I still managed to apply the wrong version of patch. Anyways, I already fixed it.

Rob