9ns: remove unused device shutdown methods
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 14 Jun 2019 19:13:06 +0000 (15:13 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 11 Jul 2019 18:29:21 +0000 (14:29 -0400)
devshutdown() is the one that does nothing.  kprof and vers had their
own empty functions, which was just confusing when I went looking for
devices that had shutdown methods.

Note that we never call shutdown, and all of the shutdown/reset/init
stuff isn't well understood.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/drivers/dev/kprof.c
kern/drivers/dev/version.c
kern/src/init.c

index 832d2c0..70f65bf 100644 (file)
@@ -177,10 +177,6 @@ static void kprof_init(void)
                                        sizeof(kprof_control_usage));
 }
 
-static void kprof_shutdown(void)
-{
-}
-
 static struct walkqid *kprof_walk(struct chan *c, struct chan *nc, char **name,
                                   unsigned int nname)
 {
@@ -590,7 +586,7 @@ struct dev kprofdevtab __devtab = {
 
        .reset = devreset,
        .init = kprof_init,
-       .shutdown = kprof_shutdown,
+       .shutdown = devshutdown,
        .attach = kprof_attach,
        .walk = kprof_walk,
        .stat = kprof_stat,
index d083eb4..8cf20d0 100644 (file)
@@ -89,11 +89,6 @@ static void ver_init(void)
        vertab[Kverkconfig].length = strlen(__kconfig_str) + 1;
 }
 
-static void ver_shutdown(void)
-{
-
-}
-
 static struct walkqid *ver_walk(struct chan *c, struct chan *nc, char **name,
                                unsigned int nname)
 {
@@ -191,7 +186,7 @@ struct dev verdevtab __devtab = {
 
        .reset = devreset,
        .init = ver_init,
-       .shutdown = ver_shutdown,
+       .shutdown = devshutdown,
        .attach = ver_attach,
        .walk = ver_walk,
        .stat = ver_stat,
index e9030fc..5205c91 100644 (file)
@@ -158,7 +158,12 @@ static void __kernel_init_part_deux(void *arg)
        enable_irq();
        run_linker_funcs();
        /* reset/init devtab after linker funcs 3 and 4.  these run NIC and
-        * medium pre-inits, which need to happen before devether. */
+        * medium pre-inits, which need to happen before devether.  Note
+        * tmpfs_reset.
+        *
+        * Reset vs init - who the fuck knows.  Both are called during init
+        * time.  It might be that init is a one-time ever per boot thing, and
+        * resets are paired with shutdowns.  So init, reset, shutdown reset. */
        devtabreset();
        devtabinit();