From: Francois Romieu <romieu@fr.zoreil.com>
To: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: Use of_property_read_bool() for boolean properties
Date: Mon, 13 Mar 2023 19:18:03 +0100 [thread overview]
Message-ID: <20230313181803.GA524627@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <20230310144718.1544169-1-robh@kernel.org>
Rob Herring <robh@kernel.org> :
> It is preferred to use typed property access functions (i.e.
> of_property_read_<type> functions) rather than low-level
> of_get_property/of_find_property functions for reading properties.
> Convert reading boolean properties to to of_property_read_bool().
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
[...]
> drivers/net/ethernet/via/via-velocity.c | 3 +--
[...]
> diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
> index a502812ac418..86f7843b4591 100644
> --- a/drivers/net/ethernet/via/via-velocity.c
> +++ b/drivers/net/ethernet/via/via-velocity.c
> @@ -2709,8 +2709,7 @@ static int velocity_get_platform_info(struct velocity_info *vptr)
> struct resource res;
> int ret;
>
> - if (of_get_property(vptr->dev->of_node, "no-eeprom", NULL))
> - vptr->no_eeprom = 1;
> + vptr->no_eeprom = of_property_read_bool(vptr->dev->of_node, "no-eeprom");
>
> ret = of_address_to_resource(vptr->dev->of_node, 0, &res);
> if (ret) {
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Simon Horman's comment regarding assignment of bool value to an integer
typed field also apply here.
--
Ueimor
next prev parent reply other threads:[~2023-03-13 18:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 14:47 Rob Herring
2023-03-11 11:50 ` Simon Horman
2023-03-14 19:14 ` Rob Herring
2023-03-15 8:35 ` Simon Horman
2023-03-12 10:16 ` Marc Kleine-Budde
2023-03-13 6:57 ` Kalle Valo
2023-03-13 9:09 ` Nicolas Ferre
2023-03-13 18:18 ` Francois Romieu [this message]
2023-03-14 2:12 ` Wei Fang
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=20230313181803.GA524627@electric-eye.fr.zoreil.com \
--to=romieu@fr.zoreil.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=robh@kernel.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
all inboxes | Powered by JetHome®