| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * FUJITSU Extended Socket Network Device driver |
|---|
| 3 | 4 | * Copyright (c) 2015-2016 FUJITSU LIMITED |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 6 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 7 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 12 | | - * more details. |
|---|
| 13 | | - * |
|---|
| 14 | | - * You should have received a copy of the GNU General Public License along with |
|---|
| 15 | | - * this program; if not, see <http://www.gnu.org/licenses/>. |
|---|
| 16 | | - * |
|---|
| 17 | | - * The full GNU General Public License is included in this distribution in |
|---|
| 18 | | - * the file called "COPYING". |
|---|
| 19 | | - * |
|---|
| 20 | 5 | */ |
|---|
| 21 | 6 | |
|---|
| 22 | 7 | /* debugfs support for fjes driver */ |
|---|
| .. | .. |
|---|
| 62 | 47 | |
|---|
| 63 | 48 | return 0; |
|---|
| 64 | 49 | } |
|---|
| 65 | | - |
|---|
| 66 | | -static int fjes_dbg_status_open(struct inode *inode, struct file *file) |
|---|
| 67 | | -{ |
|---|
| 68 | | - return single_open(file, fjes_dbg_status_show, inode->i_private); |
|---|
| 69 | | -} |
|---|
| 70 | | - |
|---|
| 71 | | -static const struct file_operations fjes_dbg_status_fops = { |
|---|
| 72 | | - .owner = THIS_MODULE, |
|---|
| 73 | | - .open = fjes_dbg_status_open, |
|---|
| 74 | | - .read = seq_read, |
|---|
| 75 | | - .llseek = seq_lseek, |
|---|
| 76 | | - .release = single_release, |
|---|
| 77 | | -}; |
|---|
| 50 | +DEFINE_SHOW_ATTRIBUTE(fjes_dbg_status); |
|---|
| 78 | 51 | |
|---|
| 79 | 52 | void fjes_dbg_adapter_init(struct fjes_adapter *adapter) |
|---|
| 80 | 53 | { |
|---|
| 81 | 54 | const char *name = dev_name(&adapter->plat_dev->dev); |
|---|
| 82 | | - struct dentry *pfile; |
|---|
| 83 | 55 | |
|---|
| 84 | 56 | adapter->dbg_adapter = debugfs_create_dir(name, fjes_debug_root); |
|---|
| 85 | | - if (!adapter->dbg_adapter) { |
|---|
| 86 | | - dev_err(&adapter->plat_dev->dev, |
|---|
| 87 | | - "debugfs entry for %s failed\n", name); |
|---|
| 88 | | - return; |
|---|
| 89 | | - } |
|---|
| 90 | 57 | |
|---|
| 91 | | - pfile = debugfs_create_file("status", 0444, adapter->dbg_adapter, |
|---|
| 92 | | - adapter, &fjes_dbg_status_fops); |
|---|
| 93 | | - if (!pfile) |
|---|
| 94 | | - dev_err(&adapter->plat_dev->dev, |
|---|
| 95 | | - "debugfs status for %s failed\n", name); |
|---|
| 58 | + debugfs_create_file("status", 0444, adapter->dbg_adapter, adapter, |
|---|
| 59 | + &fjes_dbg_status_fops); |
|---|
| 96 | 60 | } |
|---|
| 97 | 61 | |
|---|
| 98 | 62 | void fjes_dbg_adapter_exit(struct fjes_adapter *adapter) |
|---|
| .. | .. |
|---|
| 104 | 68 | void fjes_dbg_init(void) |
|---|
| 105 | 69 | { |
|---|
| 106 | 70 | fjes_debug_root = debugfs_create_dir(fjes_driver_name, NULL); |
|---|
| 107 | | - if (!fjes_debug_root) |
|---|
| 108 | | - pr_info("init of debugfs failed\n"); |
|---|
| 109 | 71 | } |
|---|
| 110 | 72 | |
|---|
| 111 | 73 | void fjes_dbg_exit(void) |
|---|