.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright 2014 IBM Corp. |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or |
---|
5 | | - * modify it under the terms of the GNU General Public License |
---|
6 | | - * as published by the Free Software Foundation; either version |
---|
7 | | - * 2 of the License, or (at your option) any later version. |
---|
8 | 4 | */ |
---|
9 | 5 | |
---|
10 | 6 | #include <linux/debugfs.h> |
---|
.. | .. |
---|
30 | 26 | DEFINE_DEBUGFS_ATTRIBUTE(fops_io_x64, debugfs_io_u64_get, debugfs_io_u64_set, |
---|
31 | 27 | "0x%016llx\n"); |
---|
32 | 28 | |
---|
33 | | -static struct dentry *debugfs_create_io_x64(const char *name, umode_t mode, |
---|
34 | | - struct dentry *parent, u64 __iomem *value) |
---|
| 29 | +static void debugfs_create_io_x64(const char *name, umode_t mode, |
---|
| 30 | + struct dentry *parent, u64 __iomem *value) |
---|
35 | 31 | { |
---|
36 | | - return debugfs_create_file_unsafe(name, mode, parent, |
---|
37 | | - (void __force *)value, &fops_io_x64); |
---|
| 32 | + debugfs_create_file_unsafe(name, mode, parent, (void __force *)value, |
---|
| 33 | + &fops_io_x64); |
---|
38 | 34 | } |
---|
39 | 35 | |
---|
40 | 36 | void cxl_debugfs_add_adapter_regs_psl9(struct cxl *adapter, struct dentry *dir) |
---|
.. | .. |
---|
58 | 54 | debugfs_create_io_x64("trace", S_IRUSR | S_IWUSR, dir, _cxl_p1_addr(adapter, CXL_PSL_TRACE)); |
---|
59 | 55 | } |
---|
60 | 56 | |
---|
61 | | -int cxl_debugfs_adapter_add(struct cxl *adapter) |
---|
| 57 | +void cxl_debugfs_adapter_add(struct cxl *adapter) |
---|
62 | 58 | { |
---|
63 | 59 | struct dentry *dir; |
---|
64 | 60 | char buf[32]; |
---|
65 | 61 | |
---|
66 | 62 | if (!cxl_debugfs) |
---|
67 | | - return -ENODEV; |
---|
| 63 | + return; |
---|
68 | 64 | |
---|
69 | 65 | snprintf(buf, 32, "card%i", adapter->adapter_num); |
---|
70 | 66 | dir = debugfs_create_dir(buf, cxl_debugfs); |
---|
71 | | - if (IS_ERR(dir)) |
---|
72 | | - return PTR_ERR(dir); |
---|
73 | 67 | adapter->debugfs = dir; |
---|
74 | 68 | |
---|
75 | 69 | debugfs_create_io_x64("err_ivte", S_IRUSR, dir, _cxl_p1_addr(adapter, CXL_PSL_ErrIVTE)); |
---|
76 | 70 | |
---|
77 | 71 | if (adapter->native->sl_ops->debugfs_add_adapter_regs) |
---|
78 | 72 | adapter->native->sl_ops->debugfs_add_adapter_regs(adapter, dir); |
---|
79 | | - return 0; |
---|
80 | 73 | } |
---|
81 | 74 | |
---|
82 | 75 | void cxl_debugfs_adapter_remove(struct cxl *adapter) |
---|
.. | .. |
---|
100 | 93 | debugfs_create_io_x64("trace", S_IRUSR | S_IWUSR, dir, _cxl_p1n_addr(afu, CXL_PSL_SLICE_TRACE)); |
---|
101 | 94 | } |
---|
102 | 95 | |
---|
103 | | -int cxl_debugfs_afu_add(struct cxl_afu *afu) |
---|
| 96 | +void cxl_debugfs_afu_add(struct cxl_afu *afu) |
---|
104 | 97 | { |
---|
105 | 98 | struct dentry *dir; |
---|
106 | 99 | char buf[32]; |
---|
107 | 100 | |
---|
108 | 101 | if (!afu->adapter->debugfs) |
---|
109 | | - return -ENODEV; |
---|
| 102 | + return; |
---|
110 | 103 | |
---|
111 | 104 | snprintf(buf, 32, "psl%i.%i", afu->adapter->adapter_num, afu->slice); |
---|
112 | 105 | dir = debugfs_create_dir(buf, afu->adapter->debugfs); |
---|
113 | | - if (IS_ERR(dir)) |
---|
114 | | - return PTR_ERR(dir); |
---|
115 | 106 | afu->debugfs = dir; |
---|
116 | 107 | |
---|
117 | 108 | debugfs_create_io_x64("sr", S_IRUSR, dir, _cxl_p1n_addr(afu, CXL_PSL_SR_An)); |
---|
.. | .. |
---|
122 | 113 | |
---|
123 | 114 | if (afu->adapter->native->sl_ops->debugfs_add_afu_regs) |
---|
124 | 115 | afu->adapter->native->sl_ops->debugfs_add_afu_regs(afu, dir); |
---|
125 | | - |
---|
126 | | - return 0; |
---|
127 | 116 | } |
---|
128 | 117 | |
---|
129 | 118 | void cxl_debugfs_afu_remove(struct cxl_afu *afu) |
---|
.. | .. |
---|
131 | 120 | debugfs_remove_recursive(afu->debugfs); |
---|
132 | 121 | } |
---|
133 | 122 | |
---|
134 | | -int __init cxl_debugfs_init(void) |
---|
| 123 | +void __init cxl_debugfs_init(void) |
---|
135 | 124 | { |
---|
136 | | - struct dentry *ent; |
---|
137 | | - |
---|
138 | 125 | if (!cpu_has_feature(CPU_FTR_HVMODE)) |
---|
139 | | - return 0; |
---|
| 126 | + return; |
---|
140 | 127 | |
---|
141 | | - ent = debugfs_create_dir("cxl", NULL); |
---|
142 | | - if (IS_ERR(ent)) |
---|
143 | | - return PTR_ERR(ent); |
---|
144 | | - cxl_debugfs = ent; |
---|
145 | | - |
---|
146 | | - return 0; |
---|
| 128 | + cxl_debugfs = debugfs_create_dir("cxl", NULL); |
---|
147 | 129 | } |
---|
148 | 130 | |
---|
149 | 131 | void cxl_debugfs_exit(void) |
---|