From patchwork Mon Nov 6 13:26:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 118036 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2766795qgn; Mon, 6 Nov 2017 05:28:37 -0800 (PST) X-Google-Smtp-Source: ABhQp+SKJvnaFr1RLjwz4FXYcjInnRf8Ue77G0/AUxdWITq8xewKnx0yWbKmMiBulD2z32twZyxW X-Received: by 10.159.203.197 with SMTP id r5mr14732230plo.431.1509974917753; Mon, 06 Nov 2017 05:28:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509974917; cv=none; d=google.com; s=arc-20160816; b=xoUVmFgqjZNBbe3C2tQmj6zqbxwdFKjG6Eoz6ZOhdfOeOKOTQPWVt6XTKvXSAXiXbp 2rk4VtxepnL9OK48XElupjQJeDmAapfiAFfz0gDB1SYVFYBgIUdxvwJ9pAri/cM5OTWx UbP/qcnTGwrlmz8jOZJYRBjsSnWr7iKri1YPw/iMjibSkwFvs0FHyBAkVmSyncxxl77W 10KPSZaiqxujrIdqIsHOrYu1J2hKR8Xhet9f1U3+JlXh6lHz1LSmePOwViIE6kvmhDU2 Jgx2iPl1FC1rbaNVh7TPXgfCMNINh38UI2lroFELLesfQ3EdjSBArDDkHK4LzTjGw+2v dd9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+jlpKbh9vlHeEa7kLZ+7CfvseIFjrgSU1R+4j3DQ2MA=; b=h2soe1pqlRt9N71DB9R+zvXYsqQwxryjZQlSyaIn1AOnLpYN6eYyImZb3kP2NQwmfN wfvH1xyvbyij573ZgrXSX0LlEBHfCzVMS6QIWjW+UXJdQvfK4MQQyCGXbuZh4nvzgoZB H8wZ7AzZ+zE6N1MMhtOjRIJ4x9gOlj7euIRYi7mbFiWwwrwCoYRJPHPwHdnVOZreZkrF r42WKg6g2qiHTm87mc1PcXzmcMTFB6uZVJaQDhopwNCNGjMoOd63r95W1G4/aqhf6e1+ L5MnmpQ07pUPkCEqLx4UJrE688CJY+p5Y6E4fR2A3kusCWgl696oUATGLkoj/JH7w48N Evvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si10103913plh.0.2017.11.06.05.28.37; Mon, 06 Nov 2017 05:28:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753365AbdKFN2g (ORCPT + 26 others); Mon, 6 Nov 2017 08:28:36 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:53541 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753096AbdKFN12 (ORCPT ); Mon, 6 Nov 2017 08:27:28 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lu4L0-1fCyzc0wfG-011OZU; Mon, 06 Nov 2017 14:26:34 +0100 From: Arnd Bergmann To: Vivien Didelot , "David S . Miller" , Rob Herring , Frank Rowand Cc: netdev@vger.kernel.org, Arnd Bergmann , Sakari Ailus , Grant Likely , "Rafael J. Wysocki" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [net-next?] of: add of_property_read_variable_* dummy helpers Date: Mon, 6 Nov 2017 14:26:10 +0100 Message-Id: <20171106132627.150459-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:C4ODqtUWgcvsx6iEh3OB7LgBi139YZxK5VR0FAHcX0ixorXkbol bK0+EDMUYP0BgzfmbOSfrl/EX3tAGGdL9BGDxggUoajKlOjqgmmNThU1WTsAS6eGXoRvg0c 5FIOgRBvhV8Z4cfXFIeO+xixBtP/icPa0Kt/BGx4SWtAtzDDN61JdCPQD5B0WGTPtF+4W6K U/XsRBDLdSnIsmr1mlCnQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:rxYm5+pjRVw=:YxAdeTTTBezGYvW49A/zBk lAQvtyCPlyWFItxuH3II0sBeggUZNS7/wm82x0Atklkq16rmYPDOH2H0mLXw+cOWmf8gQWcRL IywtvnvY/DIVZDSy0tHmfkGC2nq4dYFGFddsP9zrI0hO2qTcPrH5kAHdgwF67Y2mlpC0+zBod +23NEKDiWMMafucRXGJNri9Y3tWx1PJgXBgjIuhWJzQt+S6zJTIu/ixdQrhgi11+/saqLrEu5 ummPiv3A6jgHfq0txedKBl1rxiN7YxRSKz8ZMOc34i/dtJAZkl2RnNH1I2dumN4y7+33SDagL wP41pxV11ioEpdFJU7J8PSuKpkMgSm19xk9FDeEoeVLRzAaFIxJ78u85sVpbGpo/H+PEYqa12 O6lkCXzCUxFqGBWWQxEjQwrqbr/e/QZ0myoOEr9gl+dI+8vM78G5gRNJP/0aYmqk2FRvbnyYm FityVm4NJwhVgSOtSQbzDHn+JOlS/XQvBBLY28kqk2/+20y0UNyZf5koV/SaiU8xdr8XcslNA gha3UXrDBZnRP9GsfDjA920bk5pmwC6Tilr8+CbOahjNPlIQNStIy28H1DwlrNP6vFgyBYVbM /vKjUjUgIn/Y0W2E8EsNydj9+kINcKFzZBtcHJOFrXWC4t9sooDJhG9oDr/0WQlrKgDEwe/ye YoW/XbU4GTuT5ZJb/lbCKTk5942hAaHW2sD/MYUFpleLRJwv+rquX+GpnUIgLccJkwboDZadk KZSEJ9iEJx0Vtf+3cmm/3QHQtB2pnIWPQzjpNw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- DT maintainers: there is currently a build break in the net-next tree (from branch "dsa-parsing-stage") because of this, I think the best way forward would be to get an Ack for this patch to get picked up through the netdev trees. --- include/linux/of.h | 62 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 12 deletions(-) -- 2.9.0 diff --git a/include/linux/of.h b/include/linux/of.h index 43b5034c6a1e..d3dea1d1e3a9 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -681,12 +681,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) { @@ -713,16 +707,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; } @@ -750,12 +742,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) @@ -763,6 +794,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)