xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/ssv6xxx/bridge/debug.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright (c) 2015 South Silicon Valley Microelectronics Inc.
3  * Copyright (c) 2015 iComm Corporation
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  * See the GNU General Public License for more details.
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #include <linux/slab.h>
18 #include <linux/vmalloc.h>
19 #include <linux/export.h>
20 #include <asm/unaligned.h>
21 #include "debug.h"
ssv_sdiobridge_init_debug(struct ssv_sdiobridge_glue * glue)22 int ssv_sdiobridge_init_debug(struct ssv_sdiobridge_glue *glue)
23 {
24  glue->debugfs = debugfs_create_dir("ssv",
25          NULL);
26  if (!glue->debugfs)
27   return -ENOMEM;
28  glue->dump_entry = debugfs_create_bool("sdiobridge_dump", S_IRUSR, glue->debugfs, &glue->dump);
29  return 0;
30 }
ssv_sdiobridge_deinit_debug(struct ssv_sdiobridge_glue * glue)31 void ssv_sdiobridge_deinit_debug(struct ssv_sdiobridge_glue *glue)
32 {
33     if (!glue->dump_entry)
34   debugfs_remove(glue->dump_entry);
35 }
36