summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerve Codina <Herve.CODINA@celad.com>2015-07-06 09:36:44 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-07-13 08:28:19 +0200
commita59a48b684f9173f30ba407ca2d64a9c12e7c2e5 (patch)
tree557e56bd88a3971ebd71dbf9d032d93ce3dd3fc1
parenta2136e6cbd732e627f9f33d9211ba0a67be52889 (diff)
downloadbarebox-a59a48b684f9173f30ba407ca2d64a9c12e7c2e5.tar.gz
barebox-a59a48b684f9173f30ba407ca2d64a9c12e7c2e5.tar.xz
exitcall: move device_shutdown to exitcall infrastructure
Signed-off-by: Herve Codina <Herve.CODINA@celad.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/startup.c1
-rw-r--r--drivers/base/driver.c3
-rw-r--r--include/driver.h5
3 files changed, 2 insertions, 7 deletions
diff --git a/common/startup.c b/common/startup.c
index 45d8d86aee..0e5de63ffc 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -151,7 +151,6 @@ void shutdown_barebox(void)
(*exitcall)();
}
- devices_shutdown();
#ifdef ARCH_SHUTDOWN
arch_shutdown();
#endif
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 338bea1280..943deb489c 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -459,7 +459,7 @@ const char *dev_id(const struct device_d *dev)
return buf;
}
-void devices_shutdown(void)
+static void devices_shutdown(void)
{
struct device_d *dev;
@@ -468,6 +468,7 @@ void devices_shutdown(void)
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 9c6005454c..728f8abb49 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -339,11 +339,6 @@ int mem_memmap(struct cdev *cdev, void **map, int flags);
/* 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);