diff options
author | Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> | 2018-02-09 20:49:06 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-03-14 12:11:37 +0300 |
commit | 45ddea8a73a25461387eb8e87f3e0ecca084799b (patch) | |
tree | c5944db09cf3f45f1fb35f9042e020e33c3ec61b /arch/powerpc/platforms/powernv/vas-debug.c | |
parent | 720c84046c26444fe825f8614ddceb5c46539e67 (diff) | |
download | linux-45ddea8a73a25461387eb8e87f3e0ecca084799b.tar.xz |
powerpc/vas: Fix cleanup when VAS is not configured
When VAS is not configured, unregister the platform driver. Also simplify
cleanup by delaying vas debugfs init until we know VAS is configured.
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv/vas-debug.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/vas-debug.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/vas-debug.c b/arch/powerpc/platforms/powernv/vas-debug.c index b4de4c6fd38b..4f7276ebdf9c 100644 --- a/arch/powerpc/platforms/powernv/vas-debug.c +++ b/arch/powerpc/platforms/powernv/vas-debug.c @@ -179,6 +179,7 @@ void vas_instance_init_dbgdir(struct vas_instance *vinst) { struct dentry *d; + vas_init_dbgdir(); if (!vas_debugfs) return; @@ -201,8 +202,18 @@ free_name: vinst->dbgdir = NULL; } +/* + * Set up the "root" VAS debugfs dir. Return if we already set it up + * (or failed to) in an earlier instance of VAS. + */ void vas_init_dbgdir(void) { + static bool first_time = true; + + if (!first_time) + return; + + first_time = false; vas_debugfs = debugfs_create_dir("vas", NULL); if (IS_ERR(vas_debugfs)) vas_debugfs = NULL; |