linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Yang Li <yang.lee@linux.alibaba.com>, <damien.lemoal@opensource.wdc.com>
Cc: <linux-ide@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] ata: pata_macio: Use of_property_present() helper
Date: Tue, 21 Feb 2023 13:03:48 +0300	[thread overview]
Message-ID: <2465c8aa-7098-e225-0b4c-c27f60a933b8@omp.ru> (raw)
In-Reply-To: <20230221023634.87925-1-yang.lee@linux.alibaba.com>

Hello!

On 2/21/23 5:36 AM, Yang Li wrote:

> Use of_property_present() instead of of_get_property/of_find_property()

   I'm not seeing of_property_present() anywhere (we have of_prperty_read_bool()
though)... what repo was this patch done against?

> in places where we just need to test presence of a property.
> 
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  drivers/ata/pata_macio.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
> index 9ccaac9e2bc3..f698d77e87e1 100644
> --- a/drivers/ata/pata_macio.c
> +++ b/drivers/ata/pata_macio.c
> @@ -479,10 +479,9 @@ static int pata_macio_cable_detect(struct ata_port *ap)
>  	    priv->kind == controller_un_ata6 ||
>  	    priv->kind == controller_k2_ata6 ||
>  	    priv->kind == controller_sh_ata6) {
> -		const char* cable = of_get_property(priv->node, "cable-type",
> -						    NULL);
> +		const char *cable = of_property_present(priv->node, "cable-type");
>  		struct device_node *root = of_find_node_by_path("/");
> -		const char *model = of_get_property(root, "model", NULL);
> +		const char *model = of_property_present(root, "model");

   We use the values of these properties...

[...]
> @@ -973,7 +972,7 @@ static void pata_macio_invariants(struct pata_macio_priv *priv)
>  	/* XXX FIXME --- setup priv->mediabay here */
>  
>  	/* Get Apple bus ID (for clock and ASIC control) */
> -	bidp = of_get_property(priv->node, "AAPL,bus-id", NULL);
> +	bidp = of_property_present(priv->node, "AAPL,bus-id");

   And this one too...

[...]

MBR, Sergey

      parent reply	other threads:[~2023-02-21 10:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21  2:36 [PATCH -next] ata: pata_macio: Use of_property_present() helper Yang Li
2023-02-21  6:31 ` kernel test robot
2023-02-21 10:03 ` Sergey Shtylyov [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=2465c8aa-7098-e225-0b4c-c27f60a933b8@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yang.lee@linux.alibaba.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;
as well as URLs for NNTP newsgroup(s).