From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] of: have of_property_match_string accept pointer to const device_node
Date: Wed, 7 Dec 2022 07:58:09 +0100 [thread overview]
Message-ID: <20221207065809.GZ29728@pengutronix.de> (raw)
In-Reply-To: <20221205133227.3010785-1-a.fatoum@pengutronix.de>
On Mon, Dec 05, 2022 at 02:32:26PM +0100, Ahmad Fatoum wrote:
> This function need not have mutable access to the device node, so make
> the parameter const to allow calling it from more places without
> sacrificing cost safety.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> drivers/of/base.c | 2 +-
> include/of.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 2eee1279a98d..221050a19715 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1049,7 +1049,7 @@ EXPORT_SYMBOL_GPL(of_property_read_string);
> * This function searches a string list property and returns the index
> * of a specific string value.
> */
> -int of_property_match_string(struct device_node *np, const char *propname,
> +int of_property_match_string(const struct device_node *np, const char *propname,
> const char *string)
> {
> struct property *prop = of_find_property(np, propname, NULL);
> diff --git a/include/of.h b/include/of.h
> index 052d5fcad84c..c19a17584e47 100644
> --- a/include/of.h
> +++ b/include/of.h
> @@ -229,7 +229,7 @@ extern int of_property_read_variable_u64_array(const struct device_node *np,
> extern int of_property_read_string(struct device_node *np,
> const char *propname,
> const char **out_string);
> -extern int of_property_match_string(struct device_node *np,
> +extern int of_property_match_string(const struct device_node *np,
> const char *propname,
> const char *string);
> extern int of_property_read_string_helper(const struct device_node *np,
> @@ -616,7 +616,7 @@ static inline int of_property_read_string(struct device_node *np,
> return -ENOSYS;
> }
>
> -static inline int of_property_match_string(struct device_node *np,
> +static inline int of_property_match_string(const struct device_node *np,
> const char *propname, const char *string)
> {
> return -ENOSYS;
> --
> 2.30.2
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2022-12-07 6:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 13:32 Ahmad Fatoum
2022-12-05 13:32 ` [PATCH 2/2] of: platform: port Linux of_dma_is_coherent Ahmad Fatoum
2022-12-07 6:58 ` Sascha Hauer [this message]
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=20221207065809.GZ29728@pengutronix.de \
--to=sha@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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