devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Rob Herring <robh@kernel.org>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>, Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Javier Martinez Canillas <javierm@redhat.com>,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: Use of_property_read_bool() for boolean properties
Date: Fri, 10 Mar 2023 16:59:35 +0200	[thread overview]
Message-ID: <20230310145935.GI5342@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20230310144706.1542295-1-robh@kernel.org>

Hi Rob,

Thank you for the patch.

On Fri, Mar 10, 2023 at 08:47:05AM -0600, Rob Herring wrote:
> 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().

s/to to/to/ (or maybe "to use" ?)

With this,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/gpu/drm/bridge/parade-ps8622.c | 2 +-
>  drivers/gpu/drm/tiny/ofdrm.c           | 8 ++------
>  2 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c
> index 530ee6a19e7e..efa80e309b98 100644
> --- a/drivers/gpu/drm/bridge/parade-ps8622.c
> +++ b/drivers/gpu/drm/bridge/parade-ps8622.c
> @@ -496,7 +496,7 @@ static int ps8622_probe(struct i2c_client *client)
>  		ps8622->lane_count = ps8622->max_lane_count;
>  	}
>  
> -	if (!of_find_property(dev->of_node, "use-external-pwm", NULL)) {
> +	if (!of_property_read_bool(dev->of_node, "use-external-pwm")) {
>  		ps8622->bl = backlight_device_register("ps8622-backlight",
>  				dev, ps8622, &ps8622_backlight_ops,
>  				NULL);
> diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/tiny/ofdrm.c
> index 6e349ca42485..76cd7f515bab 100644
> --- a/drivers/gpu/drm/tiny/ofdrm.c
> +++ b/drivers/gpu/drm/tiny/ofdrm.c
> @@ -162,13 +162,9 @@ static bool display_get_big_endian_of(struct drm_device *dev, struct device_node
>  	bool big_endian;
>  
>  #ifdef __BIG_ENDIAN
> -	big_endian = true;
> -	if (of_get_property(of_node, "little-endian", NULL))
> -		big_endian = false;
> +	big_endian = !of_property_read_bool(of_node, "little-endian");
>  #else
> -	big_endian = false;
> -	if (of_get_property(of_node, "big-endian", NULL))
> -		big_endian = true;
> +	big_endian = of_property_read_bool(of_node, "big-endian");
>  #endif
>  
>  	return big_endian;

-- 
Regards,

Laurent Pinchart

      reply	other threads:[~2023-03-10 15:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 14:47 [PATCH] drm: Use of_property_read_bool() for boolean properties Rob Herring
2023-03-10 14:59 ` Laurent Pinchart [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=20230310145935.GI5342@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=robh@kernel.org \
    --cc=tzimmermann@suse.de \
    /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).