From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753137AbbGAXMY (ORCPT ); Wed, 1 Jul 2015 19:12:24 -0400 Received: from v094114.home.net.pl ([79.96.170.134]:43071 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750808AbbGAXMR (ORCPT ); Wed, 1 Jul 2015 19:12:17 -0400 From: "Rafael J. Wysocki" To: Tomeu Vizoso Cc: linux-kernel@vger.kernel.org, Mark Brown , Greg Kroah-Hartman Subject: Re: [PATCH v1 05/10] device property: add fwnode_get_name() Date: Thu, 02 Jul 2015 01:38:37 +0200 Message-ID: <2843363.SN8sM9ebvO@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.1.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1435676108-20590-6-git-send-email-tomeu.vizoso@collabora.com> References: <1435676108-20590-1-git-send-email-tomeu.vizoso@collabora.com> <1435676108-20590-6-git-send-email-tomeu.vizoso@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, June 30, 2015 04:55:03 PM Tomeu Vizoso wrote: > Getting a textual representation of a device node can be very useful for > debugging. > > Signed-off-by: Tomeu Vizoso Fine by me. > --- > > drivers/base/property.c | 15 +++++++++++++++ > include/linux/property.h | 2 ++ > 2 files changed, 17 insertions(+) > > diff --git a/drivers/base/property.c b/drivers/base/property.c > index a7fb46b..3280b04 100644 > --- a/drivers/base/property.c > +++ b/drivers/base/property.c > @@ -556,3 +556,18 @@ struct fwnode_handle *fwnode_get_parent(struct fwnode_handle *fwnode) > return NULL; > } > EXPORT_SYMBOL_GPL(fwnode_get_parent); > + > +/** > + * fwnode_get_name - return the name of a device node > + * @fwnode: Device node to find the name of > + */ > +const char *fwnode_get_name(struct fwnode_handle *fwnode) > +{ > + if (is_of_node(fwnode)) > + return to_of_node(fwnode)->full_name; > + else if (is_acpi_node(fwnode)) > + return acpi_dev_name(to_acpi_node(fwnode)); > + > + return NULL; > +} > +EXPORT_SYMBOL_GPL(fwnode_get_name); > diff --git a/include/linux/property.h b/include/linux/property.h > index f47092d..020a53c 100644 > --- a/include/linux/property.h > +++ b/include/linux/property.h > @@ -65,6 +65,8 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev, > > struct fwnode_handle *fwnode_get_parent(struct fwnode_handle *fwnode); > > +const char *fwnode_get_name(struct fwnode_handle *fwnode); > + > #define device_for_each_child_node(dev, child) \ > for (child = device_get_next_child_node(dev, NULL); child; \ > child = device_get_next_child_node(dev, child)) > -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.