forked from luck/tmp_suning_uos_patched
04672fe6d6
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin street fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 46 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141334.135501091@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
65 lines
1.6 KiB
C
65 lines
1.6 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Linux WiMAX
|
|
* Debugfs support
|
|
*
|
|
* Copyright (C) 2005-2006 Intel Corporation <linux-wimax@intel.com>
|
|
* Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
|
|
*/
|
|
#include <linux/debugfs.h>
|
|
#include <linux/wimax.h>
|
|
#include "wimax-internal.h"
|
|
|
|
#define D_SUBMODULE debugfs
|
|
#include "debug-levels.h"
|
|
|
|
|
|
#define __debugfs_register(prefix, name, parent) \
|
|
do { \
|
|
result = d_level_register_debugfs(prefix, name, parent); \
|
|
if (result < 0) \
|
|
goto error; \
|
|
} while (0)
|
|
|
|
|
|
int wimax_debugfs_add(struct wimax_dev *wimax_dev)
|
|
{
|
|
int result;
|
|
struct net_device *net_dev = wimax_dev->net_dev;
|
|
struct device *dev = net_dev->dev.parent;
|
|
struct dentry *dentry;
|
|
char buf[128];
|
|
|
|
snprintf(buf, sizeof(buf), "wimax:%s", net_dev->name);
|
|
dentry = debugfs_create_dir(buf, NULL);
|
|
result = PTR_ERR(dentry);
|
|
if (IS_ERR(dentry)) {
|
|
if (result == -ENODEV)
|
|
result = 0; /* No debugfs support */
|
|
else
|
|
dev_err(dev, "Can't create debugfs dentry: %d\n",
|
|
result);
|
|
goto out;
|
|
}
|
|
wimax_dev->debugfs_dentry = dentry;
|
|
__debugfs_register("wimax_dl_", debugfs, dentry);
|
|
__debugfs_register("wimax_dl_", id_table, dentry);
|
|
__debugfs_register("wimax_dl_", op_msg, dentry);
|
|
__debugfs_register("wimax_dl_", op_reset, dentry);
|
|
__debugfs_register("wimax_dl_", op_rfkill, dentry);
|
|
__debugfs_register("wimax_dl_", op_state_get, dentry);
|
|
__debugfs_register("wimax_dl_", stack, dentry);
|
|
result = 0;
|
|
out:
|
|
return result;
|
|
|
|
error:
|
|
debugfs_remove_recursive(wimax_dev->debugfs_dentry);
|
|
return result;
|
|
}
|
|
|
|
void wimax_debugfs_rm(struct wimax_dev *wimax_dev)
|
|
{
|
|
debugfs_remove_recursive(wimax_dev->debugfs_dentry);
|
|
}
|