| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | #include <linux/fs.h> |
|---|
| 2 | 3 | #include <linux/interrupt.h> |
|---|
| 3 | 4 | #include <asm/octeon/octeon.h> |
|---|
| .. | .. |
|---|
| 63 | 64 | |
|---|
| 64 | 65 | DEFINE_SIMPLE_ATTRIBUTE(reset_statistics_ops, NULL, reset_statistics, "%llu\n"); |
|---|
| 65 | 66 | |
|---|
| 66 | | -static int init_debufs(void) |
|---|
| 67 | +static void init_debugfs(void) |
|---|
| 67 | 68 | { |
|---|
| 68 | | - struct dentry *show_dentry; |
|---|
| 69 | 69 | dir = debugfs_create_dir("oct_ilm", 0); |
|---|
| 70 | | - if (!dir) { |
|---|
| 71 | | - pr_err("oct_ilm: failed to create debugfs entry oct_ilm\n"); |
|---|
| 72 | | - return -1; |
|---|
| 73 | | - } |
|---|
| 74 | | - |
|---|
| 75 | | - show_dentry = debugfs_create_file("statistics", 0222, dir, NULL, |
|---|
| 76 | | - &oct_ilm_ops); |
|---|
| 77 | | - if (!show_dentry) { |
|---|
| 78 | | - pr_err("oct_ilm: failed to create debugfs entry oct_ilm/statistics\n"); |
|---|
| 79 | | - return -1; |
|---|
| 80 | | - } |
|---|
| 81 | | - |
|---|
| 82 | | - show_dentry = debugfs_create_file("reset", 0222, dir, NULL, |
|---|
| 83 | | - &reset_statistics_ops); |
|---|
| 84 | | - if (!show_dentry) { |
|---|
| 85 | | - pr_err("oct_ilm: failed to create debugfs entry oct_ilm/reset\n"); |
|---|
| 86 | | - return -1; |
|---|
| 87 | | - } |
|---|
| 88 | | - |
|---|
| 89 | | - return 0; |
|---|
| 90 | | - |
|---|
| 70 | + debugfs_create_file("statistics", 0222, dir, NULL, &oct_ilm_ops); |
|---|
| 71 | + debugfs_create_file("reset", 0222, dir, NULL, &reset_statistics_ops); |
|---|
| 91 | 72 | } |
|---|
| 92 | 73 | |
|---|
| 93 | 74 | static void init_latency_info(struct latency_info *li, int startup) |
|---|
| .. | .. |
|---|
| 169 | 150 | int rc; |
|---|
| 170 | 151 | int irq = OCTEON_IRQ_TIMER0 + TIMER_NUM; |
|---|
| 171 | 152 | |
|---|
| 172 | | - rc = init_debufs(); |
|---|
| 173 | | - if (rc) { |
|---|
| 174 | | - WARN(1, "Could not create debugfs entries"); |
|---|
| 175 | | - return rc; |
|---|
| 176 | | - } |
|---|
| 153 | + init_debugfs(); |
|---|
| 177 | 154 | |
|---|
| 178 | 155 | rc = request_irq(irq, cvm_oct_ciu_timer_interrupt, IRQF_NO_THREAD, |
|---|
| 179 | 156 | "oct_ilm", 0); |
|---|