linux-yocto/drivers/of
Florian Fainelli e56c6a5915 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:22:23 +02:00
..
unittest-data .gitignore: move *.dtb and *.dtb.S patterns to the top-level .gitignore 2018-02-13 10:19:46 +01:00
address.c of: Add OF_DMA_DEFAULT_COHERENT & select it on powerpc 2020-02-14 16:32:13 -05:00
base.c of: fix missing kobject init for !SYSFS && OF_DYNAMIC config 2020-04-24 08:01:13 +02:00
device.c dma-mapping updates for 4.14: 2017-09-12 13:30:06 -07:00
dynamic.c of: Convert to using %pOF instead of full_name 2017-07-18 17:09:18 -05:00
fdt_address.c
fdt.c earlycon: Use a pointer table to fix __earlycon_table stride 2018-05-01 12:58:24 -07:00
irq.c DeviceTree updates for 4.14: 2017-09-07 14:43:33 -07:00
Kconfig of: Add OF_DMA_DEFAULT_COHERENT & select it on powerpc 2020-02-14 16:32:13 -05:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
of_mdio.c of: of_mdio: Correct loop scanning logic 2020-07-22 09:22:23 +02:00
of_net.c
of_numa.c of, numa: Validate some distance map rules 2018-11-21 09:24:10 +01:00
of_pci_irq.c
of_pci.c of_pci: use of_property_read_u32_array() 2017-07-24 10:00:52 -05:00
of_private.h
of_reserved_mem.c drivers: of: increase MAX_RESERVED_REGIONS to 32 2017-10-12 12:23:45 -05:00
overlay.c of: overlay: add overlay symbols to live device tree 2017-07-20 09:40:05 -05:00
pdt.c
platform.c of: platform: stop accessing invalid dev in of_platform_device_destroy 2018-07-03 11:24:52 +02:00
property.c OF: properties: add missing of_node_put 2019-01-23 08:09:49 +01:00
resolver.c of: overlay: validate offset from property fixups 2018-07-03 11:24:52 +02:00
unittest.c of: unittest: kmemleak in of_unittest_platform_populate() 2020-04-24 08:01:17 +02:00