Skip to content

Commit 96c623e

Browse files
arndbdavem330
authored andcommitted
of: add of_property_read_variable_* dummy helpers
Commit a67e947 ("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: 975e6e3 ("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>
1 parent 42ca728 commit 96c623e

File tree

1 file changed

+50
-12
lines changed

1 file changed

+50
-12
lines changed

include/linux/of.h

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -675,12 +675,6 @@ static inline int of_property_count_elems_of_size(const struct device_node *np,
675675
return -ENOSYS;
676676
}
677677

678-
static inline int of_property_read_u32_index(const struct device_node *np,
679-
const char *propname, u32 index, u32 *out_value)
680-
{
681-
return -ENOSYS;
682-
}
683-
684678
static inline int of_property_read_u8_array(const struct device_node *np,
685679
const char *propname, u8 *out_values, size_t sz)
686680
{
@@ -707,16 +701,14 @@ static inline int of_property_read_u64_array(const struct device_node *np,
707701
return -ENOSYS;
708702
}
709703

710-
static inline int of_property_read_string(const struct device_node *np,
711-
const char *propname,
712-
const char **out_string)
704+
static inline int of_property_read_u32_index(const struct device_node *np,
705+
const char *propname, u32 index, u32 *out_value)
713706
{
714707
return -ENOSYS;
715708
}
716709

717-
static inline int of_property_read_string_helper(const struct device_node *np,
718-
const char *propname,
719-
const char **out_strs, size_t sz, int index)
710+
static inline int of_property_read_u64_index(const struct device_node *np,
711+
const char *propname, u32 index, u64 *out_value)
720712
{
721713
return -ENOSYS;
722714
}
@@ -744,19 +736,65 @@ static inline int of_n_size_cells(struct device_node *np)
744736
return 0;
745737
}
746738

739+
static inline int of_property_read_variable_u8_array(const struct device_node *np,
740+
const char *propname, u8 *out_values,
741+
size_t sz_min, size_t sz_max)
742+
{
743+
return -ENOSYS;
744+
}
745+
746+
static inline int of_property_read_variable_u16_array(const struct device_node *np,
747+
const char *propname, u16 *out_values,
748+
size_t sz_min, size_t sz_max)
749+
{
750+
return -ENOSYS;
751+
}
752+
753+
static inline int of_property_read_variable_u32_array(const struct device_node *np,
754+
const char *propname,
755+
u32 *out_values,
756+
size_t sz_min,
757+
size_t sz_max)
758+
{
759+
return -ENOSYS;
760+
}
761+
747762
static inline int of_property_read_u64(const struct device_node *np,
748763
const char *propname, u64 *out_value)
749764
{
750765
return -ENOSYS;
751766
}
752767

768+
static inline int of_property_read_variable_u64_array(const struct device_node *np,
769+
const char *propname,
770+
u64 *out_values,
771+
size_t sz_min,
772+
size_t sz_max)
773+
{
774+
return -ENOSYS;
775+
}
776+
777+
static inline int of_property_read_string(const struct device_node *np,
778+
const char *propname,
779+
const char **out_string)
780+
{
781+
return -ENOSYS;
782+
}
783+
753784
static inline int of_property_match_string(const struct device_node *np,
754785
const char *propname,
755786
const char *string)
756787
{
757788
return -ENOSYS;
758789
}
759790

791+
static inline int of_property_read_string_helper(const struct device_node *np,
792+
const char *propname,
793+
const char **out_strs, size_t sz, int index)
794+
{
795+
return -ENOSYS;
796+
}
797+
760798
static inline struct device_node *of_parse_phandle(const struct device_node *np,
761799
const char *phandle_name,
762800
int index)

0 commit comments

Comments
 (0)