From: gregkh@suse.de Date: Thu, 31 Mar 2005 20:53:00 +0000 (-0800) Subject: [PATCH] Driver core: Fix up the driver and device iterators to be quieter X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b86c1df1f98d16c999423a3907eb40a9423f481e;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [PATCH] Driver core: Fix up the driver and device iterators to be quieter Also stops looping over the lists when a match is found. Signed-off-by: Greg Kroah-Hartman name, dev->bus_id, error); + if (error) { + if ((error == -ENODEV) || (error == -ENXIO)) { + /* Driver matched, but didn't support device + * or device not found. + * Not an error; keep going. + */ + error = 0; + } else { + /* driver matched but the probe failed */ + printk(KERN_WARNING + "%s: probe of %s failed with error %d\n", + drv->name, dev->bus_id, error); + } + return error; } - return 0; + /* stop looking, this device is attached */ + return 1; } /** @@ -137,7 +140,10 @@ static int __driver_attach(struct device * dev, void * data) drv->name, dev->bus_id, error); } else error = 0; + return error; } + /* stop looking, this driver is attached */ + return 1; } return 0; }