Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

driver core: fix driver_match_device

This patch fixes a bug introduced in commit
49b420a13ff95b449947181190b08367348e3e1b.

If a instance of bus_type doesn't have .match method,
all .probe of drivers in the bus should be called, or else
the .probe have not a chance to be called.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Ming Lei and committed by
Greg Kroah-Hartman
5247aecf d110271e

+1 -1
+1 -1
drivers/base/base.h
··· 115 115 static inline int driver_match_device(struct device_driver *drv, 116 116 struct device *dev) 117 117 { 118 - return drv->bus->match && drv->bus->match(dev, drv); 118 + return drv->bus->match ? drv->bus->match(dev, drv) : 1; 119 119 } 120 120 121 121 extern void sysdev_shutdown(void);