* [PATCH] memory: omap-gpmc: Use of_property_present() for non-boolean properties
@ 2025-01-09 18:21 Rob Herring (Arm)
2025-01-10 9:08 ` Roger Quadros
0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring (Arm) @ 2025-01-09 18:21 UTC (permalink / raw)
To: Roger Quadros, Tony Lindgren, Krzysztof Kozlowski
Cc: linux-omap, linux-kernel
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?
---
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;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] memory: omap-gpmc: Use of_property_present() for non-boolean properties
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
2025-01-13 14:08 ` Rob Herring
0 siblings, 1 reply; 3+ messages in thread
From: Roger Quadros @ 2025-01-10 9:08 UTC (permalink / raw)
To: Rob Herring (Arm), Tony Lindgren, Krzysztof Kozlowski
Cc: linux-omap, linux-kernel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] memory: omap-gpmc: Use of_property_present() for non-boolean properties
2025-01-10 9:08 ` Roger Quadros
@ 2025-01-13 14:08 ` Rob Herring
0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring @ 2025-01-13 14:08 UTC (permalink / raw)
To: Roger Quadros
Cc: Tony Lindgren, Krzysztof Kozlowski, linux-omap, linux-kernel
On Fri, Jan 10, 2025 at 3:08 AM Roger Quadros <rogerq@kernel.org> wrote:
>
> 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.
Please do. You would know better than me on the details of why it
would be fine to remove.
Rob
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-13 14:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-01-13 14:08 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox