lkml.org 
[lkml]   [2022]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[net-next 3/5] net: mdiobus: fwnode: avoid calling of_* functions with non OF nodes
Date
Without this check, of_parse_phandle_with_fixed_args() will be called
with whatever the type of the node. Use !is_of_node() which will work
for all node types supported by the fwnode API (ACPI, software nodes).

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
drivers/net/mdio/fwnode_mdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mdio/fwnode_mdio.c b/drivers/net/mdio/fwnode_mdio.c
index f9ec3818041a..7f71c0700c55 100644
--- a/drivers/net/mdio/fwnode_mdio.c
+++ b/drivers/net/mdio/fwnode_mdio.c
@@ -22,7 +22,7 @@ fwnode_find_mii_timestamper(struct fwnode_handle *fwnode)
struct of_phandle_args arg;
int err;

- if (is_acpi_node(fwnode))
+ if (!is_of_node(fwnode))
return NULL;

err = of_parse_phandle_with_fixed_args(to_of_node(fwnode),
--
2.34.1
\
 
 \ /
  Last update: 2022-09-17 16:19    [W:0.138 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site