]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
of: add of_property_read_variable_* dummy helpers
authorArnd Bergmann <arnd@arndb.de>
Mon, 6 Nov 2017 13:26:10 +0000 (14:26 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Nov 2017 04:31:47 +0000 (13:31 +0900)
Commit a67e9472da42 ("of: Add array read functions with min/max size
limits") added a new interface for reading variable-length arrays from
DT properties. One user was added in dsa recently and this causes a
build error because that code can be built with CONFIG_OF disabled:

net/dsa/dsa2.c: In function 'dsa_switch_parse_member_of':
net/dsa/dsa2.c:678:7: error: implicit declaration of function 'of_property_read_variable_u32_array'; did you mean 'of_property_read_u32_array'? [-Werror=implicit-function-declaration]

This adds a dummy functions for of_property_read_variable_u32_array()
and a few others that had been missing here. I decided to move
of_property_read_string() and of_property_read_string_helper() in the
process to make it easier to compare the two sets of function prototypes
to make sure they match.

Fixes: 975e6e32215e ("net: dsa: rework switch parsing")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/of.h

index b240ed69dc9626a266498807e568a5b09c0b888b..b32d418d011a977e511e95cbc9f9aa4df4394af6 100644 (file)
@@ -675,12 +675,6 @@ static inline int of_property_count_elems_of_size(const struct device_node *np,
        return -ENOSYS;
 }
 
-static inline int of_property_read_u32_index(const struct device_node *np,
-                       const char *propname, u32 index, u32 *out_value)
-{
-       return -ENOSYS;
-}
-
 static inline int of_property_read_u8_array(const struct device_node *np,
                        const char *propname, u8 *out_values, size_t sz)
 {
@@ -707,16 +701,14 @@ static inline int of_property_read_u64_array(const struct device_node *np,
        return -ENOSYS;
 }
 
-static inline int of_property_read_string(const struct device_node *np,
-                                         const char *propname,
-                                         const char **out_string)
+static inline int of_property_read_u32_index(const struct device_node *np,
+                       const char *propname, u32 index, u32 *out_value)
 {
        return -ENOSYS;
 }
 
-static inline int of_property_read_string_helper(const struct device_node *np,
-                                                const char *propname,
-                                                const char **out_strs, size_t sz, int index)
+static inline int of_property_read_u64_index(const struct device_node *np,
+                       const char *propname, u32 index, u64 *out_value)
 {
        return -ENOSYS;
 }
@@ -744,12 +736,51 @@ static inline int of_n_size_cells(struct device_node *np)
        return 0;
 }
 
+static inline int of_property_read_variable_u8_array(const struct device_node *np,
+                                       const char *propname, u8 *out_values,
+                                       size_t sz_min, size_t sz_max)
+{
+       return -ENOSYS;
+}
+
+static inline int of_property_read_variable_u16_array(const struct device_node *np,
+                                       const char *propname, u16 *out_values,
+                                       size_t sz_min, size_t sz_max)
+{
+       return -ENOSYS;
+}
+
+static inline int of_property_read_variable_u32_array(const struct device_node *np,
+                                       const char *propname,
+                                       u32 *out_values,
+                                       size_t sz_min,
+                                       size_t sz_max)
+{
+       return -ENOSYS;
+}
+
 static inline int of_property_read_u64(const struct device_node *np,
                                       const char *propname, u64 *out_value)
 {
        return -ENOSYS;
 }
 
+static inline int of_property_read_variable_u64_array(const struct device_node *np,
+                                       const char *propname,
+                                       u64 *out_values,
+                                       size_t sz_min,
+                                       size_t sz_max)
+{
+       return -ENOSYS;
+}
+
+static inline int of_property_read_string(const struct device_node *np,
+                                         const char *propname,
+                                         const char **out_string)
+{
+       return -ENOSYS;
+}
+
 static inline int of_property_match_string(const struct device_node *np,
                                           const char *propname,
                                           const char *string)
@@ -757,6 +788,13 @@ static inline int of_property_match_string(const struct device_node *np,
        return -ENOSYS;
 }
 
+static inline int of_property_read_string_helper(const struct device_node *np,
+                                                const char *propname,
+                                                const char **out_strs, size_t sz, int index)
+{
+       return -ENOSYS;
+}
+
 static inline struct device_node *of_parse_phandle(const struct device_node *np,
                                                   const char *phandle_name,
                                                   int index)