linux-stable/drivers/base
Isaac J. Manjarres dcd0248743 driver core: Fix bus_type.match() error handling in __driver_attach()
commit 27c0d21734 upstream.

When a driver registers with a bus, it will attempt to match with every
device on the bus through the __driver_attach() function. Currently, if
the bus_type.match() function encounters an error that is not
-EPROBE_DEFER, __driver_attach() will return a negative error code, which
causes the driver registration logic to stop trying to match with the
remaining devices on the bus.

This behavior is not correct; a failure while matching a driver to a
device does not mean that the driver won't be able to match and bind
with other devices on the bus. Update the logic in __driver_attach()
to reflect this.

Fixes: 656b8035b0 ("ARM: 8524/1: driver cohandle -EPROBE_DEFER from bus_type.match()")
Cc: stable@vger.kernel.org
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
Link: https://lore.kernel.org/r/20220921001414.4046492-1-isaacmanjarres@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-07 11:15:57 +01:00
..
firmware_loader
power
regmap
test
Kconfig
Makefile
arch_numa.c
arch_topology.c
attribute_container.c
auxiliary.c
base.h
bus.c
cacheinfo.c
class.c
component.c
container.c
core.c
cpu.c
dd.c
devcoredump.c
devres.c
devtmpfs.c
driver.c
firmware.c
hypervisor.c
init.c
isa.c
map.c
memory.c
module.c
node.c
physical_location.c
physical_location.h
pinctrl.c
platform-msi.c
platform.c
property.c
soc.c
swnode.c
syscore.c
topology.c
trace.c
trace.h
transport_class.c