xref: /linux/drivers/greybus/debugfs.c (revision 976e3645923bdd2fe7893aae33fd7a21098bfb28)
1*8465def4SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
2*8465def4SGreg Kroah-Hartman /*
3*8465def4SGreg Kroah-Hartman  * Greybus debugfs code
4*8465def4SGreg Kroah-Hartman  *
5*8465def4SGreg Kroah-Hartman  * Copyright 2014 Google Inc.
6*8465def4SGreg Kroah-Hartman  * Copyright 2014 Linaro Ltd.
7*8465def4SGreg Kroah-Hartman  */
8*8465def4SGreg Kroah-Hartman 
9*8465def4SGreg Kroah-Hartman #include <linux/debugfs.h>
10*8465def4SGreg Kroah-Hartman #include <linux/greybus.h>
11*8465def4SGreg Kroah-Hartman 
12*8465def4SGreg Kroah-Hartman static struct dentry *gb_debug_root;
13*8465def4SGreg Kroah-Hartman 
gb_debugfs_init(void)14*8465def4SGreg Kroah-Hartman void __init gb_debugfs_init(void)
15*8465def4SGreg Kroah-Hartman {
16*8465def4SGreg Kroah-Hartman 	gb_debug_root = debugfs_create_dir("greybus", NULL);
17*8465def4SGreg Kroah-Hartman }
18*8465def4SGreg Kroah-Hartman 
gb_debugfs_cleanup(void)19*8465def4SGreg Kroah-Hartman void gb_debugfs_cleanup(void)
20*8465def4SGreg Kroah-Hartman {
21*8465def4SGreg Kroah-Hartman 	debugfs_remove_recursive(gb_debug_root);
22*8465def4SGreg Kroah-Hartman 	gb_debug_root = NULL;
23*8465def4SGreg Kroah-Hartman }
24*8465def4SGreg Kroah-Hartman 
gb_debugfs_get(void)25*8465def4SGreg Kroah-Hartman struct dentry *gb_debugfs_get(void)
26*8465def4SGreg Kroah-Hartman {
27*8465def4SGreg Kroah-Hartman 	return gb_debug_root;
28*8465def4SGreg Kroah-Hartman }
29*8465def4SGreg Kroah-Hartman EXPORT_SYMBOL_GPL(gb_debugfs_get);
30