[alsa-devel] [PATCH v3 1/2] device property: Add function to search for named child of device

Rob Herring robh+dt at kernel.org
Tue Jun 14 17:49:59 CEST 2016


On Tue, Jun 14, 2016 at 8:56 AM, Adam Thomson
<Adam.Thomson.Opensource at diasemi.com> 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 <Adam.Thomson.Opensource at diasemi.com>
> Tested-by: Sathyanarayana Nujella <sathyanarayana.nujella at intel.com>
> ---
>
> 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 <robh at kernel.org>


More information about the Alsa-devel mailing list