> index 36d0c654ea6124..03591f82251302 100644 > --- a/drivers/base/bus.c > +++ b/drivers/base/bus.c > @@ -212,13 +212,9 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf, > dev = bus_find_device_by_name(bus, NULL, buf); > if (dev && dev->driver == NULL && driver_match_device(drv, dev)) { > err = device_driver_attach(drv, dev); > - > - if (err > 0) { > + if (!err) { > /* success */ > err = count; > - } else if (err == 0) { > - /* driver didn't accept device */ > - err = -ENODEV; > } > } I think we can also drop the dev->driver == NULL check above given that device_driver_attach covers it now.