diff --git a/commands/detect.c b/commands/detect.c index d68d738..48bab4d 100644 --- a/commands/detect.c +++ b/commands/detect.c @@ -54,9 +54,7 @@ } if (option_all) { - for_each_device(dev) - device_detect(dev); - + device_detect_all(); return 0; } diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 8326099..c43a4bd 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -140,6 +140,14 @@ return ret; } +void device_detect_all(void) +{ + struct device_d *dev; + + for_each_device(dev) + device_detect(dev); +} + static int match(struct driver_d *drv, struct device_d *dev) { int ret; diff --git a/include/driver.h b/include/driver.h index 8617872..e571fbb 100644 --- a/include/driver.h +++ b/include/driver.h @@ -134,6 +134,7 @@ /* detect devices attached to this device (cards, disks,...) */ int device_detect(struct device_d *dev); int device_detect_by_name(const char *devname); +void device_detect_all(void); /* Unregister a device. This function can fail, e.g. when the device * has children.