summaryrefslogtreecommitdiffstats
path: root/atahpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'atahpt.c')
-rw-r--r--atahpt.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/atahpt.c b/atahpt.c
index 82b430d..2bf4a11 100644
--- a/atahpt.c
+++ b/atahpt.c
@@ -38,6 +38,14 @@ const struct pcidev_status ata_hpt[] = {
{},
};
+static int atahpt_shutdown(void *data)
+{
+ /* Flash access is disabled automatically by PCI restore. */
+ pci_cleanup(pacc);
+ release_io_perms();
+ return 0;
+}
+
int atahpt_init(void)
{
uint32_t reg32;
@@ -53,14 +61,8 @@ int atahpt_init(void)
buses_supported = CHIP_BUSTYPE_PARALLEL;
- return 0;
-}
-
-int atahpt_shutdown(void)
-{
- /* Flash access is disabled automatically by PCI restore. */
- pci_cleanup(pacc);
- release_io_perms();
+ if (register_shutdown(atahpt_shutdown, NULL))
+ return 1;
return 0;
}
OpenPOWER on IntegriCloud