From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-acpi@vger.kernel.org
Cc: devicetree@vger.kernel.org, sudeep.holla@arm.com,
lorenzo.pieralisi@arm.com, mika.westerberg@linux.intel.com,
rafael@kernel.org, mark.rutland@arm.com, broonie@kernel.org,
robh@kernel.org, ahs3@redhat.com, frowand.list@gmail.com
Subject: [PATCH 1/7] ACPI: Constify acpi_get_next_subnode() fwnode argument
Date: Mon, 22 May 2017 12:07:36 +0300 [thread overview]
Message-ID: <1495444062-23867-2-git-send-email-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <1495444062-23867-1-git-send-email-sakari.ailus@linux.intel.com>
This is preparation for making fwnode arguments const for fwnode ops.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/acpi/property.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index e90f674..bfa726c 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -900,12 +900,14 @@ int acpi_node_prop_read(struct fwnode_handle *fwnode, const char *propname,
struct fwnode_handle *acpi_get_next_subnode(struct fwnode_handle *fwnode,
struct fwnode_handle *child)
{
- struct acpi_device *adev = to_acpi_device_node(fwnode);
- struct list_head *head, *next;
+ const struct acpi_device *adevc = to_acpi_device_node(fwnode);
+ struct acpi_device *adev = NULL;
+ const struct list_head *head;
+ struct list_head *next;
if (!child || child->type == FWNODE_ACPI) {
- if (adev)
- head = &adev->children;
+ if (adevc)
+ head = &adevc->children;
else
goto nondev;
@@ -928,11 +930,13 @@ struct fwnode_handle *acpi_get_next_subnode(struct fwnode_handle *fwnode,
nondev:
if (!child || child->type == FWNODE_ACPI_DATA) {
- struct acpi_data_node *data = to_acpi_data_node(fwnode);
+ const struct acpi_data_node *data = to_acpi_data_node(fwnode);
struct acpi_data_node *dn;
if (adev)
head = &adev->data.subnodes;
+ else if (adevc)
+ head = &adevc->data.subnodes;
else if (data)
head = &data->data.subnodes;
else
--
2.7.4
next prev parent reply other threads:[~2017-05-22 9:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-22 9:07 [PATCH 0/7] Constify property fwnode arguments Sakari Ailus
2017-05-22 9:07 ` Sakari Ailus [this message]
2017-05-22 9:07 ` [PATCH 2/7] ACPI: Constify acpi_bus helper functions, switch to macros Sakari Ailus
2017-05-22 9:07 ` [PATCH 3/7] ACPI: Constify internal fwnode arguments Sakari Ailus
2017-05-22 9:07 ` [PATCH 4/7] device property: Constify argument to pset fwnode backend Sakari Ailus
2017-05-22 9:07 ` [PATCH 5/7] device property: Constify fwnode property API Sakari Ailus
2017-05-22 9:07 ` [PATCH 6/7] v4l: fwnode: Constify fwnode endpoints Sakari Ailus
[not found] ` <1495444062-23867-1-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-05-22 9:07 ` [PATCH 7/7] v4l2-async: Make fwnode const Sakari Ailus
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=1495444062-23867-2-git-send-email-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=ahs3@redhat.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=mark.rutland@arm.com \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=sudeep.holla@arm.com \
/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).