Greg Kroah-Hartman | eb50fd3 | 2017-11-07 14:58:41 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Greg Kroah-Hartman | 27fb831 | 2014-08-31 13:54:59 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Greybus debugfs code |
| 4 | * |
| 5 | * Copyright 2014 Google Inc. |
Alex Elder | a46e967 | 2014-12-12 12:08:42 -0600 | [diff] [blame] | 6 | * Copyright 2014 Linaro Ltd. |
Greg Kroah-Hartman | 27fb831 | 2014-08-31 13:54:59 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
Greg Kroah-Hartman | 27fb831 | 2014-08-31 13:54:59 -0700 | [diff] [blame] | 9 | #include <linux/debugfs.h> |
Greg Kroah-Hartman | ec0ad86 | 2019-08-25 07:54:27 +0200 | [diff] [blame] | 10 | #include <linux/greybus.h> |
Greg Kroah-Hartman | 27fb831 | 2014-08-31 13:54:59 -0700 | [diff] [blame] | 11 | |
| 12 | static struct dentry *gb_debug_root; |
| 13 | |
Alex Elder | 47ed2c9 | 2015-06-09 17:42:50 -0500 | [diff] [blame] | 14 | void __init gb_debugfs_init(void) |
Greg Kroah-Hartman | 27fb831 | 2014-08-31 13:54:59 -0700 | [diff] [blame] | 15 | { |
| 16 | gb_debug_root = debugfs_create_dir("greybus", NULL); |
Greg Kroah-Hartman | 27fb831 | 2014-08-31 13:54:59 -0700 | [diff] [blame] | 17 | } |
| 18 | |
Greg Kroah-Hartman | de536e3 | 2014-08-31 16:17:04 -0700 | [diff] [blame] | 19 | void gb_debugfs_cleanup(void) |
Greg Kroah-Hartman | 27fb831 | 2014-08-31 13:54:59 -0700 | [diff] [blame] | 20 | { |
| 21 | debugfs_remove_recursive(gb_debug_root); |
Viresh Kumar | f66832d | 2014-11-14 17:25:01 +0530 | [diff] [blame] | 22 | gb_debug_root = NULL; |
Greg Kroah-Hartman | 27fb831 | 2014-08-31 13:54:59 -0700 | [diff] [blame] | 23 | } |
Alexandre Bailon | e8f824b | 2015-03-18 15:42:51 +0100 | [diff] [blame] | 24 | |
| 25 | struct dentry *gb_debugfs_get(void) |
| 26 | { |
| 27 | return gb_debug_root; |
| 28 | } |
| 29 | EXPORT_SYMBOL_GPL(gb_debugfs_get); |