A driver without .probe() callback could never bind to a device because anybus_bus_probe() returned an error for such a driver. So refuse to register such a useless driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> --- drivers/staging/fieldbus/anybuss/host.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fieldbus/anybuss/host.c b/drivers/staging/fieldbus/anybuss/host.c index de6c287efa03..0f730efe9a6d 100644 --- a/drivers/staging/fieldbus/anybuss/host.c +++ b/drivers/staging/fieldbus/anybuss/host.c @@ -1183,8 +1183,6 @@ static int anybus_bus_probe(struct device *dev) struct anybuss_client *adev = to_anybuss_client(dev); - if (!adrv->probe) - return -ENODEV; return adrv->probe(adev); } @@ -1208,6 +1206,9 @@ static struct bus_type anybus_bus = { int anybuss_client_driver_register(struct anybuss_client_driver *drv) { + if (!drv->probe) + return -ENODEV; + drv->driver.bus = &anybus_bus; return driver_register(&drv->driver); } -- 2.30.2