of: Add stub for of_add_property()
authorWesley Cheng <wcheng@codeaurora.org>
Sat, 10 Jul 2021 09:13:13 +0000 (02:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Jul 2021 07:37:26 +0000 (09:37 +0200)
If building with OF Kconfig disabled, this can lead to errors for
drivers utilizing of_add_property().  Add a stub for the add API, as
it exists for the remove variant as well, and to avoid compliation
issues.  Also, export this API so that it can be used by modules.

Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/1625908395-5498-5-git-send-email-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/of/base.c
include/linux/of.h

index 48e941f99558e737b846c1bdb18ad83f778fd94c..5883d63c77146eceedd96b3de6cef983ca1bfabc 100644 (file)
@@ -1821,6 +1821,7 @@ int of_add_property(struct device_node *np, struct property *prop)
 
        return rc;
 }
+EXPORT_SYMBOL_GPL(of_add_property);
 
 int __of_remove_property(struct device_node *np, struct property *prop)
 {
index 9c2e71e202d1c4be7675a2bb6707410079bc67cc..0e786b60bd5d71bd9d60e27d60e3a59856842cc7 100644 (file)
@@ -946,6 +946,11 @@ static inline int of_machine_is_compatible(const char *compat)
        return 0;
 }
 
+static inline int of_add_property(struct device_node *np, struct property *prop)
+{
+       return 0;
+}
+
 static inline int of_remove_property(struct device_node *np, struct property *prop)
 {
        return 0;