linux/drivers/of
Florian Fainelli fefc7580af of: of_mdio: Correct loop scanning logic
[ Upstream commit 5a8d7f126c ]

Commit 209c65b61d ("drivers/of/of_mdio.c:fix of_mdiobus_register()")
introduced a break of the loop on the premise that a successful
registration should exit the loop. The premise is correct but not to
code, because rc && rc != -ENODEV is just a special error condition,
that means we would exit the loop even with rc == -ENODEV which is
absolutely not correct since this is the error code to indicate to the
MDIO bus layer that scanning should continue.

Fix this by explicitly checking for rc = 0 as the only valid condition
to break out of the loop.

Fixes: 209c65b61d ("drivers/of/of_mdio.c:fix of_mdiobus_register()")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-07-22 09:32:55 +02:00
..
unittest-data
Kconfig
Makefile
address.c
base.c
device.c
dynamic.c
fdt.c
fdt_address.c
irq.c
kobj.c of: Fix a refcounting bug in __of_attach_node_sysfs() 2020-06-24 17:50:35 +02:00
of_mdio.c of: of_mdio: Correct loop scanning logic 2020-07-22 09:32:55 +02:00
of_net.c
of_numa.c
of_private.h
of_reserved_mem.c
overlay.c of: overlay: kmemleak in dup_and_fixup_symbol_prop() 2020-04-23 10:36:23 +02:00
pdt.c
platform.c
property.c
resolver.c
unittest.c of: unittest: kmemleak in of_unittest_overlay_high_level() 2020-04-23 10:36:23 +02:00