From: Geert Uytterhoeven Date: Wed, 5 Feb 2025 16:09:47 +0000 (+0100) Subject: net: pcs: rzn1-miic: Convert to for_each_available_child_of_node() helper X-Git-Tag: v6.15-rc1~160^2~379 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec7309525a37b3f34c4efa85fc2ecaa65f41830e;p=thirdparty%2Fkernel%2Flinux.git net: pcs: rzn1-miic: Convert to for_each_available_child_of_node() helper Simplify miic_parse_dt() by using the for_each_available_child_of_node() helper instead of manually skipping unavailable child nodes. Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman Link: https://patch.msgid.link/3e394d4cf8204bcf17b184bfda474085aa8ed0dd.1738771631.git.geert+renesas@glider.be Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/pcs/pcs-rzn1-miic.c b/drivers/net/pcs/pcs-rzn1-miic.c index 11a96459a425d..a808ac7375f5d 100644 --- a/drivers/net/pcs/pcs-rzn1-miic.c +++ b/drivers/net/pcs/pcs-rzn1-miic.c @@ -464,13 +464,10 @@ static int miic_parse_dt(struct device *dev, u32 *mode_cfg) if (of_property_read_u32(np, "renesas,miic-switch-portin", &conf) == 0) dt_val[0] = conf; - for_each_child_of_node(np, conv) { + for_each_available_child_of_node(np, conv) { if (of_property_read_u32(conv, "reg", &port)) continue; - if (!of_device_is_available(conv)) - continue; - if (of_property_read_u32(conv, "renesas,miic-input", &conf) == 0) dt_val[port] = conf; }