From: David Daney Subject: Re: [PATCH] of/lib: Export fdt routines to modules Date: Wed, 16 Oct 2013 16:39:03 -0700 Message-ID: <525F2397.40203@caviumnetworks.com> References: <1381966065-16854-1-git-send-email-mbohan@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bn1lp0155.outbound.protection.outlook.com ([207.46.163.155]:29141 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752419Ab3JPXyM (ORCPT ); Wed, 16 Oct 2013 19:54:12 -0400 In-Reply-To: <1381966065-16854-1-git-send-email-mbohan@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Michael Bohan , David Gibson Cc: linux-kernel@vger.kernel.org, grant.likely@secretlab.ca, rob.herring@calxeda.com, ralf@linux-mips.org, devicetree-discuss@lists.ozlabs.org, david.daney@cavium.com, linux-arm-msm@vger.kernel.org On 10/16/2013 04:27 PM, Michael Bohan wrote: > Ever since the following commit, libfdt has been available for > usage in the kernel: > > commit ab25383983fb8d7786696f5371e75e79c3e9a405 > Author: David Daney > Date: Thu Jul 5 18:12:38 2012 +0200 > > of/lib: Allow scripts/dtc/libfdt to be used from kernel code > > Export these functions to modules so that they may be used > from device drivers. > > Change-Id: I7f540b7cf860c4be414e32ce183be5268b2ae6af > Signed-off-by: Michael Bohan > --- > lib/fdt.c | 6 ++++++ > lib/fdt_ro.c | 28 ++++++++++++++++++++++++++++ > lib/fdt_rw.c | 13 +++++++++++++ > lib/fdt_sw.c | 9 +++++++++ > lib/fdt_wip.c | 6 ++++++ > 5 files changed, 62 insertions(+), 0 deletions(-) > > diff --git a/lib/fdt.c b/lib/fdt.c > index 97f2006..a3fe87b 100644 > --- a/lib/fdt.c > +++ b/lib/fdt.c > @@ -1,2 +1,8 @@ > #include > +#include > #include "../scripts/dtc/libfdt/fdt.c" > + > +EXPORT_SYMBOL_GPL(fdt_next_tag); The code was all written by David Gibson, and is dual GPL/BSD licensed. So I am not sure you should be using the GPL flavor of the export directive. But more than this. I don't understand why a driver would be parsing the FDT in the first place. If there is a device tree, why hasn't it been unflattened, and thus used via the normal device tree functions. David Daney