From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751834AbcFNPu0 (ORCPT ); Tue, 14 Jun 2016 11:50:26 -0400 Received: from mail.kernel.org ([198.145.29.136]:49814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbcFNPuY (ORCPT ); Tue, 14 Jun 2016 11:50:24 -0400 MIME-Version: 1.0 In-Reply-To: <866c9edccdd89805f6a0c0aa92f8a78ae616ed61.1465908072.git.Adam.Thomson.Opensource@diasemi.com> References: <866c9edccdd89805f6a0c0aa92f8a78ae616ed61.1465908072.git.Adam.Thomson.Opensource@diasemi.com> From: Rob Herring Date: Tue, 14 Jun 2016 10:49:59 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/2] device property: Add function to search for named child of device To: Adam Thomson Cc: Robert Moore , Lv Zheng , "Rafael J.Wysocki" , Heikki Krogerus , Mika Westerberg , Len Brown , Andy Shevchenko , Frank Rowand , Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Greg Kroah-Hartman , "linux-acpi@vger.kernel.org" , devel@acpica.org, "devicetree@vger.kernel.org" , Linux-ALSA , "linux-kernel@vger.kernel.org" , Support Opensource , Sathyanarayana Nujella 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 Tue, Jun 14, 2016 at 8:56 AM, Adam Thomson wrote: > For device nodes in both DT and ACPI, it possible to have named > child nodes which contain properties (an existing example being > gpio-leds). This adds a function to find a named child node for > a device which can be used by drivers for property retrieval. > > For DT data node name matching, of_node_cmp() and similar functions are made > available outside of CONFIG_OF block so the new function can reference these > for DT and non-DT builds. > > For ACPI data node name matching, a helper function is also added > which returns false if CONFIG_ACPI is not set, otherwise it > performs a string comparison on the data node name. This avoids > using the acpi_data_node struct for non CONFIG_ACPI builds, > which would otherwise cause a build failure. > > Signed-off-by: Adam Thomson > Tested-by: Sathyanarayana Nujella > --- > > Changes in v3: > - Move of_*_cmp() functions in of.h outside of CONFIG_OF block so they are > available for non-DT builds > - In device_get_named_child_node(), use of_node_cmp() helper macro instead of > strcasecmp() (node names not alway case insensitive, depending on platform). > > Changes in v2: > - Rebase to v4.7-rc1 > > drivers/base/property.c | 28 ++++++++++++++++++++++++++++ > include/acpi/acpi_bus.h | 7 +++++++ > include/linux/acpi.h | 6 ++++++ > include/linux/of.h | 14 +++++++------- > include/linux/property.h | 3 +++ > 5 files changed, 51 insertions(+), 7 deletions(-) Acked-by: Rob Herring