mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-14 02:09:07 +08:00
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 <geert+renesas@glider.be> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/3e394d4cf8204bcf17b184bfda474085aa8ed0dd.1738771631.git.geert+renesas@glider.be Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
508df2de7b
commit
ec7309525a
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user