From patchwork Fri Aug 12 00:18:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 73827 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp367803qga; Thu, 11 Aug 2016 17:18:20 -0700 (PDT) X-Received: by 10.98.95.129 with SMTP id t123mr22039006pfb.148.1470961099956; Thu, 11 Aug 2016 17:18:19 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dc7si5639886pad.212.2016.08.11.17.18.19; Thu, 11 Aug 2016 17:18:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751271AbcHLASS (ORCPT + 7 others); Thu, 11 Aug 2016 20:18:18 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:54741 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbcHLASS (ORCPT ); Thu, 11 Aug 2016 20:18:18 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id u7C0IEQw008657; Thu, 11 Aug 2016 19:18:14 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u7C0IDKT030424; Thu, 11 Aug 2016 19:18:13 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Thu, 11 Aug 2016 19:18:13 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u7C0IDL5024553; Thu, 11 Aug 2016 19:18:13 -0500 Received: from localhost (irmo.am.dhcp.ti.com [128.247.83.68]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id u7C0ID316307; Thu, 11 Aug 2016 19:18:13 -0500 (CDT) From: Suman Anna To: Rob Herring , Frank Rowand CC: , , Bjorn Andersson , Suman Anna Subject: [PATCH] of: Export of_{add/remove/update}_property() API Date: Thu, 11 Aug 2016 19:18:08 -0500 Message-ID: <20160812001808.65199-1-s-anna@ti.com> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The of_add_property(), of_remove_property() and of_update_property() API are not exported and are limited to only built-in modules at the moment. Export these so they can be used within modules. Also added the stubs for the !CONFIG_OF case for these functions. Signed-off-by: Suman Anna --- Hi Rob, We came across a need for this during some remoteproc enhancements for providing a standard OF API. Please see the discussion in [1]. I am not sure which EXPORT_SYMBOL variant (_GPL or plain) to use as I see some mixed usage in this base, I have followed the convention used on of_find_property. [1] https://patchwork.kernel.org/patch/9237767/ drivers/of/base.c | 3 +++ include/linux/of.h | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/of/base.c b/drivers/of/base.c index 7792266db259..e6baf940db1b 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1826,6 +1826,7 @@ int of_add_property(struct device_node *np, struct property *prop) return rc; } +EXPORT_SYMBOL(of_add_property); int __of_remove_property(struct device_node *np, struct property *prop) { @@ -1894,6 +1895,7 @@ int of_remove_property(struct device_node *np, struct property *prop) return rc; } +EXPORT_SYMBOL(of_remove_property); int __of_update_property(struct device_node *np, struct property *newprop, struct property **oldpropp) @@ -1970,6 +1972,7 @@ int of_update_property(struct device_node *np, struct property *newprop) return rc; } +EXPORT_SYMBOL(of_update_property); static void of_alias_add(struct alias_prop *ap, struct device_node *np, int id, const char *stem, int stem_len) diff --git a/include/linux/of.h b/include/linux/of.h index 3d9ff8e9d803..b6f17d8f4b13 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -668,6 +668,23 @@ 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 -ENOTSUPP; +} + +static inline int of_remove_property(struct device_node *np, + struct property *prop) +{ + return -ENOTSUPP; +} + +static inline int of_update_property(struct device_node *np, + struct property *newprop) +{ + return -ENOTSUPP; +} + static inline bool of_console_check(const struct device_node *dn, const char *name, int index) { return false;