From: Cornelia Huck With the __must_check changes in the driver core, bus_rescan_devices_helper() now returns the return code of its call to device_attach(). device_attach() will return < 0 on error, 0 on no match and 1 on match. This means that bus_rescan_devices() will stop after the first successful match for a device, which is probably not what we want. Stopping on error makes sense, however. Signed-off-by: Cornelia Huck Cc: Greg KH Signed-off-by: Andrew Morton --- drivers/base/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/base/bus.c~fix-bus_rescan_devices-in-mm drivers/base/bus.c --- a/drivers/base/bus.c~fix-bus_rescan_devices-in-mm +++ a/drivers/base/bus.c @@ -576,7 +576,7 @@ static int __must_check bus_rescan_devic if (ret > 0) ret = 0; } - return ret; + return ret < 0 ? ret : 0; } /** _