Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752803AbdHISdV (ORCPT ); Wed, 9 Aug 2017 14:33:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57108 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752412AbdHISPC (ORCPT ); Wed, 9 Aug 2017 14:15:02 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sakari Ailus , Mika Westerberg , "Rafael J. Wysocki" , Chris Metcalf Subject: [PATCH 4.9 10/93] device property: Make dev_fwnode() public Date: Wed, 9 Aug 2017 11:13:03 -0700 Message-Id: <20170809181336.093237197@linuxfoundation.org> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170809181335.658857427@linuxfoundation.org> References: <20170809181335.658857427@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1641 Lines: 51 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sakari Ailus commit e44bb0cbdc88686c21e2175a990b40bf6db5d005 upstream. The function to obtain a fwnode related to a struct device is useful for drivers that use the fwnode property API: it allows not being aware of the underlying firmware implementation. Signed-off-by: Sakari Ailus Reviewed-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki Cc: Chris Metcalf Signed-off-by: Greg Kroah-Hartman --- drivers/base/property.c | 3 ++- include/linux/property.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -182,11 +182,12 @@ static int pset_prop_read_string(struct return 0; } -static inline struct fwnode_handle *dev_fwnode(struct device *dev) +struct fwnode_handle *dev_fwnode(struct device *dev) { return IS_ENABLED(CONFIG_OF) && dev->of_node ? &dev->of_node->fwnode : dev->fwnode; } +EXPORT_SYMBOL_GPL(dev_fwnode); /** * device_property_present - check if a property of a device is present --- a/include/linux/property.h +++ b/include/linux/property.h @@ -33,6 +33,8 @@ enum dev_dma_attr { DEV_DMA_COHERENT, }; +struct fwnode_handle *dev_fwnode(struct device *dev); + bool device_property_present(struct device *dev, const char *propname); int device_property_read_u8_array(struct device *dev, const char *propname, u8 *val, size_t nval);