From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: [PATCH 2/4] ACPI: property: Introduce acpi_fwnode_name()
Date: Mon, 5 Nov 2018 12:17:25 +0300 [thread overview]
Message-ID: <20181105091727.25544-3-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <20181105091727.25544-1-heikki.krogerus@linux.intel.com>
ACPI data nodes have a name, so let's return that when
fwnode_name() is called.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
drivers/acpi/property.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 8c7c4583b52d..75854e07ed64 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1219,6 +1219,11 @@ acpi_graph_get_remote_endpoint(const struct fwnode_handle *__fwnode)
return acpi_graph_get_child_prop_value(fwnode, "endpoint", endpoint_nr);
}
+static const char *acpi_fwnode_name(const struct fwnode_handle *node)
+{
+ return is_acpi_data_node(node) ? to_acpi_data_node(node)->name : NULL;
+}
+
static bool acpi_fwnode_device_is_available(const struct fwnode_handle *fwnode)
{
if (!is_acpi_device_node(fwnode))
@@ -1310,6 +1315,7 @@ acpi_fwnode_device_get_match_data(const struct fwnode_handle *fwnode,
#define DECLARE_ACPI_FWNODE_OPS(ops) \
const struct fwnode_operations ops = { \
+ .name = acpi_fwnode_name, \
.device_is_available = acpi_fwnode_device_is_available, \
.device_get_match_data = acpi_fwnode_device_get_match_data, \
.property_present = acpi_fwnode_property_present, \
--
2.19.1
next prev parent reply other threads:[~2018-11-05 9:17 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 9:17 [PATCH 0/4] device property: Add fwnode_name() helper Heikki Krogerus
2018-11-05 9:17 ` [PATCH 1/4] device property: Introduce fwnode_name() Heikki Krogerus
2018-11-05 14:37 ` Andy Shevchenko
2018-11-05 14:57 ` Heikki Krogerus
2018-11-05 9:17 ` Heikki Krogerus [this message]
2018-11-05 9:17 ` [PATCH 3/4] of/property: Introduce of_fwnode_name() Heikki Krogerus
2018-11-05 18:50 ` Rob Herring
2018-11-06 8:45 ` Heikki Krogerus
2018-11-06 10:58 ` Andy Shevchenko
2018-11-06 12:27 ` Heikki Krogerus
2018-11-06 13:18 ` Rob Herring
2018-11-06 14:28 ` Andy Shevchenko
2018-11-06 18:17 ` Rob Herring
2018-11-06 14:40 ` Heikki Krogerus
2018-11-06 14:55 ` Andy Shevchenko
2018-11-06 15:05 ` Heikki Krogerus
2018-11-06 15:53 ` Andy Shevchenko
2018-11-06 18:13 ` Rob Herring
2018-11-07 12:35 ` Heikki Krogerus
2018-11-05 9:17 ` [PATCH 4/4] device property: Drop get_named_child_node callback Heikki Krogerus
2018-11-05 14:38 ` [PATCH 0/4] device property: Add fwnode_name() helper Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181105091727.25544-3-heikki.krogerus@linux.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).