core/platform: Remove setup_post and destroy callbacks
No platforms set these, remove them.
BUG=b:187788563
TEST=compiles
Change-Id: Iab47fd83f69c7675731fd20da3b2271a1a535ae4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/mosys/+/3715727
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
diff --git a/core/cli.c b/core/cli.c
index d4cbe01..f3894dc 100644
--- a/core/cli.c
+++ b/core/cli.c
@@ -267,7 +267,7 @@
if (showtree) {
print_tree(intf);
rc = 0;
- goto exit_platform_cleanup;
+ goto exit;
}
/* run command */
@@ -277,9 +277,6 @@
if (rc < 0 && errsv == ENOSYS)
lprintf(LOG_ERR, "Command not supported on this platform\n");
-exit_platform_cleanup:
- mosys_platform_destroy(intf);
-
exit:
mosys_log_halt();
diff --git a/core/platform.c b/core/platform.c
index 5a2995a..515b582 100644
--- a/core/platform.c
+++ b/core/platform.c
@@ -67,35 +67,10 @@
if (platform_intf->setup && platform_intf->setup(platform_intf) < 0)
return NULL;
- /* call platform-specific post-setup if found */
- if (platform_intf->setup_post &&
- platform_intf->setup_post(platform_intf) < 0) {
- mosys_platform_destroy(intf);
- return NULL;
- }
-
return platform_intf;
}
/*
- * mosys_platform_destroy - clean up platform interface
- *
- * @intf: platform interface
- */
-void mosys_platform_destroy(struct platform_intf *intf)
-{
- /* Call the destroy callbacks and cleanup afterwards. */
-// invoke_destroy_callbacks();
-// cleanup_destroy_callbacks();
-
- if (intf) {
- /* cleanup interface */
- if (intf->destroy)
- intf->destroy(intf);
- }
-}
-
-/*
* platform_cmd_usage - print usage text for command
*
* @cmd: command pointer
diff --git a/include/mosys/platform.h b/include/mosys/platform.h
index 5d85407..3c5c691 100644
--- a/include/mosys/platform.h
+++ b/include/mosys/platform.h
@@ -132,8 +132,6 @@
struct platform_cb *cb; /* callbacks */
int (*setup)(struct platform_intf *intf);
- int (*setup_post)(struct platform_intf *intf);
- int (*destroy)(struct platform_intf *intf);
};
/* Used for the global linked-list of all platforms. */
@@ -205,14 +203,6 @@
extern struct platform_intf *mosys_platform_setup(void);
/*
- * mosys_platform_destroy - clean up platform interface
- *
- * @intf: platform interface
- *
- */
-extern void mosys_platform_destroy(struct platform_intf *intf);
-
-/*
* platform_cmd_usage - print usage help text for command
*
* @cmd: command pointer