Commit ec730952 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Jakub Kicinski
Browse files

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: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/3e394d4cf8204bcf17b184bfda474085aa8ed0dd.1738771631.git.geert+renesas@glider.be


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 508df2de
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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;
	}