mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Rob Herring <robh@kernel.org>, Michal Simek <michal.simek@xilinx.com>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soc: xilinx: Use of_property_present() for testing DT property presence
Date: Mon, 13 Mar 2023 11:18:56 +0100	[thread overview]
Message-ID: <c6a5dc7f-46bf-8f1e-0a9c-2614d5f1824d@amd.com> (raw)
In-Reply-To: <20230310144725.1545315-1-robh@kernel.org>



On 3/10/23 15:47, 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. As
> part of this, convert of_get_property/of_find_property calls to the
> recently added of_property_present() helper when we just want to test
> for presence of a property and nothing more.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>   drivers/soc/xilinx/zynqmp_power.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
> index 78a8a7545d1e..641dcc958911 100644
> --- a/drivers/soc/xilinx/zynqmp_power.c
> +++ b/drivers/soc/xilinx/zynqmp_power.c
> @@ -218,7 +218,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
>          } else if (ret != -EACCES && ret != -ENODEV) {
>                  dev_err(&pdev->dev, "Failed to Register with Xilinx Event manager %d\n", ret);
>                  return ret;
> -       } else if (of_find_property(pdev->dev.of_node, "mboxes", NULL)) {
> +       } else if (of_property_present(pdev->dev.of_node, "mboxes")) {
>                  zynqmp_pm_init_suspend_work =
>                          devm_kzalloc(&pdev->dev,
>                                       sizeof(struct zynqmp_pm_work_struct),
> @@ -240,7 +240,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
>                          dev_err(&pdev->dev, "Failed to request rx channel\n");
>                          return PTR_ERR(rx_chan);
>                  }
> -       } else if (of_find_property(pdev->dev.of_node, "interrupts", NULL)) {
> +       } else if (of_property_present(pdev->dev.of_node, "interrupts")) {
>                  irq = platform_get_irq(pdev, 0);
>                  if (irq <= 0)
>                          return -ENXIO;
> --
> 2.39.2
> 

Waiting for v2 because of missing of.h header reported by lkp.
https://lore.kernel.org/all/202303120017.BIw01Y21-lkp@intel.com/

M

  parent reply	other threads:[~2023-03-13 10:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 14:47 Rob Herring
2023-03-11 16:15 ` kernel test robot
2023-03-13 10:18 ` Michal Simek [this message]
2023-03-14 13:23   ` Rob Herring
2023-03-28  7:37     ` Michal Simek

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=c6a5dc7f-46bf-8f1e-0a9c-2614d5f1824d@amd.com \
    --to=michal.simek@amd.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --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®