summaryrefslogtreecommitdiffstats
path: root/include/linux/of.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-11-06 08:26:10 -0500
committerDavid S. Miller <davem@davemloft.net>2017-11-07 23:31:47 -0500
commit96c623e51f1c40bf524decc48c6fac7ce5dd41f7 (patch)
tree85caff486b0f40a3179aeac2eb11f159cc5d3538 /include/linux/of.h
parent42ca728b829b8fee8ac85adb79eaffd36f0b4e06 (diff)
of: add of_property_read_variable_* dummy helpers
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>
Diffstat (limited to 'include/linux/of.h')
-rw-r--r--include/linux/of.h62
1 files changed, 50 insertions, 12 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index b240ed69dc96..b32d418d011a 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -675,12 +675,6 @@ static inline int of_property_count_elems_of_size(const struct device_node *np,
675 return -ENOSYS; 675 return -ENOSYS;
676} 676}
677 677
678static 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
684static inline int of_property_read_u8_array(const struct device_node *np, 678static inline int of_property_read_u8_array(const struct device_node *np,
685 const char *propname, u8 *out_values, size_t sz) 679 const char *propname, u8 *out_values, size_t sz)
686{ 680{
@@ -707,16 +701,14 @@ static inline int of_property_read_u64_array(const struct device_node *np,
707 return -ENOSYS; 701 return -ENOSYS;
708} 702}
709 703
710static inline int of_property_read_string(const struct device_node *np, 704static inline int of_property_read_u32_index(const struct device_node *np,
711 const char *propname, 705 const char *propname, u32 index, u32 *out_value)
712 const char **out_string)
713{ 706{
714 return -ENOSYS; 707 return -ENOSYS;
715} 708}
716 709
717static inline int of_property_read_string_helper(const struct device_node *np, 710static inline int of_property_read_u64_index(const struct device_node *np,
718 const char *propname, 711 const char *propname, u32 index, u64 *out_value)
719 const char **out_strs, size_t sz, int index)
720{ 712{
721 return -ENOSYS; 713 return -ENOSYS;
722} 714}
@@ -744,12 +736,51 @@ static inline int of_n_size_cells(struct device_node *np)
744 return 0; 736 return 0;
745} 737}
746 738
739static 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
746static 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
753static 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
747static inline int of_property_read_u64(const struct device_node *np, 762static inline int of_property_read_u64(const struct device_node *np,
748 const char *propname, u64 *out_value) 763 const char *propname, u64 *out_value)
749{ 764{
750 return -ENOSYS; 765 return -ENOSYS;
751} 766}
752 767
768static 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
777static 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
753static inline int of_property_match_string(const struct device_node *np, 784static inline int of_property_match_string(const struct device_node *np,
754 const char *propname, 785 const char *propname,
755 const char *string) 786 const char *string)
@@ -757,6 +788,13 @@ static inline int of_property_match_string(const struct device_node *np,
757 return -ENOSYS; 788 return -ENOSYS;
758} 789}
759 790
791static 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
760static inline struct device_node *of_parse_phandle(const struct device_node *np, 798static inline struct device_node *of_parse_phandle(const struct device_node *np,
761 const char *phandle_name, 799 const char *phandle_name,
762 int index) 800 int index)