public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: "Rob Herring (Arm)" <robh@kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] memory: omap-gpmc: Use of_property_present() for non-boolean properties
Date: Fri, 10 Jan 2025 11:08:47 +0200	[thread overview]
Message-ID: <75ead807-4ad1-4f82-8ce1-dea68ef9d9ab@kernel.org> (raw)
In-Reply-To: <20250109182110.3970894-1-robh@kernel.org>

Hi Rob,

On 09/01/2025 20:21, Rob Herring (Arm) wrote:
> The use of of_property_read_bool() for non-boolean properties is
> deprecated in favor of of_property_present() when testing for property
> presence.
> 
> While we're here, simplify the 2 checks into a single check as they
> only differ in printing "NAND" vs "OneNAND" in the warning.
> 
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> Possibly this check could just be removed altogether?

Yes, I agree it is better to just drop these checks.
Let me know if you want me to prepare the path. Thanks.

> ---
>  drivers/memory/omap-gpmc.c | 16 +++-------------
>  1 file changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> index e2a75a52563f..329bad46065c 100644
> --- a/drivers/memory/omap-gpmc.c
> +++ b/drivers/memory/omap-gpmc.c
> @@ -2226,21 +2226,11 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
>  		goto err;
>  	}
>  
> -	if (of_node_name_eq(child, "nand")) {
> +	if (of_node_name_eq(child, "nand") || of_node_name_eq(child, "onenand")) {
>  		/* Warn about older DT blobs with no compatible property */
> -		if (!of_property_read_bool(child, "compatible")) {
> +		if (!of_property_present(child, "compatible")) {
>  			dev_warn(&pdev->dev,
> -				 "Incompatible NAND node: missing compatible");
> -			ret = -EINVAL;
> -			goto err;
> -		}
> -	}
> -
> -	if (of_node_name_eq(child, "onenand")) {
> -		/* Warn about older DT blobs with no compatible property */
> -		if (!of_property_read_bool(child, "compatible")) {
> -			dev_warn(&pdev->dev,
> -				 "Incompatible OneNAND node: missing compatible");
> +				 "Incompatible '%pOFn' node: missing compatible", child);
>  			ret = -EINVAL;
>  			goto err;
>  		}

-- 
cheers,
-roger


  reply	other threads:[~2025-01-10  9:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09 18:21 [PATCH] memory: omap-gpmc: Use of_property_present() for non-boolean properties Rob Herring (Arm)
2025-01-10  9:08 ` Roger Quadros [this message]
2025-01-13 14:08   ` Rob Herring

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=75ead807-4ad1-4f82-8ce1-dea68ef9d9ab@kernel.org \
    --to=rogerq@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=tony@atomide.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