diff --git a/common/startup.c b/common/startup.c index 45d8d86..0e5de63 100644 --- a/common/startup.c +++ b/common/startup.c @@ -151,7 +151,6 @@ (*exitcall)(); } - devices_shutdown(); #ifdef ARCH_SHUTDOWN arch_shutdown(); #endif diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 338bea1..943deb4 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -459,7 +459,7 @@ return buf; } -void devices_shutdown(void) +static void devices_shutdown(void) { struct device_d *dev; @@ -468,6 +468,7 @@ dev->bus->remove(dev); } } +devshutdown_exitcall(devices_shutdown); int dev_get_drvdata(struct device_d *dev, const void **data) { diff --git a/include/driver.h b/include/driver.h index 9c60054..728f8ab 100644 --- a/include/driver.h +++ b/include/driver.h @@ -339,11 +339,6 @@ /* Use this if you have nothing to do in your drivers probe function */ int dummy_probe(struct device_d *); -/* Iterate over all activated devices (i.e. the ones with drivers and shut - * them down. - */ -void devices_shutdown(void); - int generic_memmap_ro(struct cdev *dev, void **map, int flags); int generic_memmap_rw(struct cdev *dev, void **map, int flags);