| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * QLogic iSCSI Offload Driver |
|---|
| 3 | 4 | * Copyright (c) 2016 Cavium Inc. |
|---|
| 4 | | - * |
|---|
| 5 | | - * This software is available under the terms of the GNU General Public License |
|---|
| 6 | | - * (GPL) Version 2, available from the file COPYING in the main directory of |
|---|
| 7 | | - * this source tree. |
|---|
| 8 | 5 | */ |
|---|
| 9 | 6 | |
|---|
| 10 | 7 | #include "qedi.h" |
|---|
| .. | .. |
|---|
| 23 | 20 | const struct file_operations *fops) |
|---|
| 24 | 21 | { |
|---|
| 25 | 22 | char host_dirname[32]; |
|---|
| 26 | | - struct dentry *file_dentry = NULL; |
|---|
| 27 | 23 | |
|---|
| 28 | 24 | sprintf(host_dirname, "host%u", qedi->host_no); |
|---|
| 29 | 25 | qedi->bdf_dentry = debugfs_create_dir(host_dirname, qedi_dbg_root); |
|---|
| 30 | | - if (!qedi->bdf_dentry) |
|---|
| 31 | | - return; |
|---|
| 32 | 26 | |
|---|
| 33 | 27 | while (dops) { |
|---|
| 34 | 28 | if (!(dops->name)) |
|---|
| 35 | 29 | break; |
|---|
| 36 | 30 | |
|---|
| 37 | | - file_dentry = debugfs_create_file(dops->name, 0600, |
|---|
| 38 | | - qedi->bdf_dentry, qedi, |
|---|
| 39 | | - fops); |
|---|
| 40 | | - if (!file_dentry) { |
|---|
| 41 | | - QEDI_INFO(qedi, QEDI_LOG_DEBUGFS, |
|---|
| 42 | | - "Debugfs entry %s creation failed\n", |
|---|
| 43 | | - dops->name); |
|---|
| 44 | | - debugfs_remove_recursive(qedi->bdf_dentry); |
|---|
| 45 | | - return; |
|---|
| 46 | | - } |
|---|
| 31 | + debugfs_create_file(dops->name, 0600, qedi->bdf_dentry, qedi, |
|---|
| 32 | + fops); |
|---|
| 47 | 33 | dops++; |
|---|
| 48 | 34 | fops++; |
|---|
| 49 | 35 | } |
|---|
| .. | .. |
|---|
| 60 | 46 | qedi_dbg_init(char *drv_name) |
|---|
| 61 | 47 | { |
|---|
| 62 | 48 | qedi_dbg_root = debugfs_create_dir(drv_name, NULL); |
|---|
| 63 | | - if (!qedi_dbg_root) |
|---|
| 64 | | - QEDI_INFO(NULL, QEDI_LOG_DEBUGFS, "Init of debugfs failed\n"); |
|---|
| 65 | 49 | } |
|---|
| 66 | 50 | |
|---|
| 67 | 51 | void |
|---|