Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751499AbdISHwt (ORCPT ); Tue, 19 Sep 2017 03:52:49 -0400 Received: from mga06.intel.com ([134.134.136.31]:18980 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750948AbdISHws (ORCPT ); Tue, 19 Sep 2017 03:52:48 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,417,1500966000"; d="scan'208";a="901689174" Date: Tue, 19 Sep 2017 10:44:00 +0300 From: Mika Westerberg To: john.hubbard@gmail.com Cc: LKML , Rob Herring , Sakari Ailus , "Rafael J . Wysocki" , John Hubbard Subject: Re: [PATCH 1/1] acpi: unbreak ACPI_HANDLE(), encapsulate fwnode_operations Message-ID: <20170919074400.GG4630@lahna.fi.intel.com> References: <20170916003527.3081-1-jhubbard@nvidia.com> <20170916003527.3081-2-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170916003527.3081-2-jhubbard@nvidia.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1661 Lines: 37 On Fri, Sep 15, 2017 at 05:35:27PM -0700, john.hubbard@gmail.com wrote: > From: John Hubbard > > Due to commit db3e50f3234b ("device property: Get rid of struct > fwnode_handle type field"), ACPI_HANDLE() inadvertently became > a GPL-only call. The call path that led to that was: > > ACPI_HANDLE() > ACPI_COMPANION() > to_acpi_device_node() > is_acpi_device_node() > acpi_device_fwnode_ops > DECLARE_ACPI_FWNODE_OPS(acpi_device_fwnode_ops); > > ...and the new DECLARE_ACPI_FWNODE_OPS() includes > EXPORT_SYMBOL_GPL, whereas previously it was a static struct. > > In order to avoid changing any of that, let's instead provide ever > so slightly better encapsulation of those struct fwnode_operations > instances. Those do not really need to be directly used in > inline function calls in header files. Simply moving two small > functions (is_acpi_device_node and is_acpi_data_node) out of > acpi_bus.h, and into a .c file, does that. > > That leaves the internals of struct fwnode_operations as GPL-only > (which I think was the intent all along), but un-breaks any driver > code out there that relies on the ACPI subsystem's being (historically) > an EXPORT_SYMBOL-usable system. By that, I mean, ACPI_HANDLE() and > other basic ACPI calls were non-GPL-protected. > > Also, while I'm there, remove a tiny bit of redundancy that was missed > in the earlier commit, by having is_acpi_node() use the other two > routines, instead of checking fwnode directly. > > Signed-off-by: John Hubbard Acked-by: Mika Westerberg