From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Rob Herring <robh@kernel.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Cc: Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Len Brown <lenb@kernel.org>
Subject: [PATCH v6 5/5] device property: Constify fwnode APIs that uses fwnode_get_next_parent()
Date: Fri, 8 Apr 2022 21:48:44 +0300 [thread overview]
Message-ID: <20220408184844.22829-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220408184844.22829-1-andriy.shevchenko@linux.intel.com>
Due to fwnode_get_next_parent() used to be called against the parameters
of some of fwnode APIs those parameters have no const qualifier. However,
after switching to fwnode_for_each_parent_node() API now it's possible to
constify the parameters. Do it for good.
The affected functions are:
fwnode_get_next_parent_dev()
fwnode_get_nth_parent()
fwnode_is_ancestor_of()
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
v6: added tag (Sakari), since previous patch no warnings anymore (LKP)
drivers/base/property.c | 7 +++----
include/linux/property.h | 9 ++++-----
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 1ad4b37cd312..f289f582209c 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -594,7 +594,7 @@ EXPORT_SYMBOL_GPL(fwnode_get_next_parent);
* The caller of this function is expected to call put_device() on the returned
* device when they are done.
*/
-struct device *fwnode_get_next_parent_dev(struct fwnode_handle *fwnode)
+struct device *fwnode_get_next_parent_dev(const struct fwnode_handle *fwnode)
{
struct fwnode_handle *parent;
struct device *dev;
@@ -639,8 +639,7 @@ EXPORT_SYMBOL_GPL(fwnode_count_parents);
* The caller is responsible for calling fwnode_handle_put() for the returned
* node.
*/
-struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwnode,
- unsigned int depth)
+struct fwnode_handle *fwnode_get_nth_parent(const struct fwnode_handle *fwnode, unsigned int depth)
{
struct fwnode_handle *parent;
@@ -664,7 +663,7 @@ EXPORT_SYMBOL_GPL(fwnode_get_nth_parent);
*
* Returns true if @ancestor is an ancestor of @child. Otherwise, returns false.
*/
-bool fwnode_is_ancestor_of(struct fwnode_handle *ancestor, struct fwnode_handle *child)
+bool fwnode_is_ancestor_of(const struct fwnode_handle *ancestor, const struct fwnode_handle *child)
{
struct fwnode_handle *parent;
diff --git a/include/linux/property.h b/include/linux/property.h
index c631ee7fd161..e3390401dd63 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -91,11 +91,10 @@ struct fwnode_handle *fwnode_get_next_parent(struct fwnode_handle *fwnode);
for (parent = fwnode_get_parent(fwnode); parent; \
parent = fwnode_get_next_parent(parent))
-struct device *fwnode_get_next_parent_dev(struct fwnode_handle *fwnode);
-unsigned int fwnode_count_parents(const struct fwnode_handle *fwn);
-struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwn,
- unsigned int depth);
-bool fwnode_is_ancestor_of(struct fwnode_handle *ancestor, struct fwnode_handle *child);
+struct device *fwnode_get_next_parent_dev(const struct fwnode_handle *fwnode);
+unsigned int fwnode_count_parents(const struct fwnode_handle *fwnode);
+struct fwnode_handle *fwnode_get_nth_parent(const struct fwnode_handle *fwnode, unsigned int depth);
+bool fwnode_is_ancestor_of(const struct fwnode_handle *ancestor, const struct fwnode_handle *child);
struct fwnode_handle *fwnode_get_next_child_node(
const struct fwnode_handle *fwnode, struct fwnode_handle *child);
struct fwnode_handle *fwnode_get_next_available_child_node(
--
2.35.1
next prev parent reply other threads:[~2022-04-08 18:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 18:48 [PATCH v6 1/5] device property: Allow error pointer to be passed to fwnode APIs Andy Shevchenko
2022-04-08 18:48 ` [PATCH v6 2/5] device property: Introduce fwnode_for_each_parent_node() Andy Shevchenko
2022-04-29 23:45 ` Doug Anderson
2022-04-08 18:48 ` [PATCH v6 3/5] device property: Drop 'test' prefix in parameters of fwnode_is_ancestor_of() Andy Shevchenko
2022-04-08 18:48 ` [PATCH v6 4/5] device property: Constify fwnode_handle_get() Andy Shevchenko
2022-04-08 21:36 ` Sakari Ailus
2022-04-10 14:10 ` Andy Shevchenko
2022-04-13 14:35 ` Sakari Ailus
2022-04-13 16:54 ` Andy Shevchenko
2022-04-13 18:21 ` Rafael J. Wysocki
2022-04-09 2:38 ` kernel test robot
2022-04-09 3:39 ` kernel test robot
2022-04-13 18:10 ` Rafael J. Wysocki
2022-04-13 18:19 ` Andy Shevchenko
2022-04-13 18:23 ` Andy Shevchenko
2022-04-13 21:47 ` Sakari Ailus
2022-04-14 13:09 ` Andy Shevchenko
2022-04-15 15:40 ` Rafael J. Wysocki
2022-04-08 18:48 ` Andy Shevchenko [this message]
2022-04-11 13:50 ` [PATCH v6 1/5] device property: Allow error pointer to be passed to fwnode APIs Andy Shevchenko
2022-04-11 14:28 ` Greg Kroah-Hartman
2022-04-11 15:46 ` Andy Shevchenko
2022-04-13 18:06 ` Rafael J. Wysocki
2022-04-13 18:20 ` 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=20220408184844.22829-5-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=djrscally@gmail.com \
--cc=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.