.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * srm_env.c - Access to SRM environment |
---|
3 | 4 | * variables through linux' procfs |
---|
.. | .. |
---|
9 | 10 | * <J.A.K.Mouw@its.tudelft.nl>. It is based on an idea |
---|
10 | 11 | * provided by DEC^WCompaq^WIntel's "Jumpstart" CD. They |
---|
11 | 12 | * included a patch like this as well. Thanks for idea! |
---|
12 | | - * |
---|
13 | | - * This program is free software; you can redistribute |
---|
14 | | - * it and/or modify it under the terms of the GNU General |
---|
15 | | - * Public License version 2 as published by the Free Software |
---|
16 | | - * Foundation. |
---|
17 | | - * |
---|
18 | | - * This program is distributed in the hope that it will be |
---|
19 | | - * useful, but WITHOUT ANY WARRANTY; without even the implied |
---|
20 | | - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
---|
21 | | - * PURPOSE. See the GNU General Public License for more |
---|
22 | | - * details. |
---|
23 | | - * |
---|
24 | | - * You should have received a copy of the GNU General Public |
---|
25 | | - * License along with this program; if not, write to the |
---|
26 | | - * Free Software Foundation, Inc., 59 Temple Place, |
---|
27 | | - * Suite 330, Boston, MA 02111-1307 USA |
---|
28 | | - * |
---|
29 | 13 | */ |
---|
30 | 14 | |
---|
31 | 15 | #include <linux/kernel.h> |
---|
.. | .. |
---|
135 | 119 | return res; |
---|
136 | 120 | } |
---|
137 | 121 | |
---|
138 | | -static const struct file_operations srm_env_proc_fops = { |
---|
139 | | - .owner = THIS_MODULE, |
---|
140 | | - .open = srm_env_proc_open, |
---|
141 | | - .read = seq_read, |
---|
142 | | - .llseek = seq_lseek, |
---|
143 | | - .release = single_release, |
---|
144 | | - .write = srm_env_proc_write, |
---|
| 122 | +static const struct proc_ops srm_env_proc_ops = { |
---|
| 123 | + .proc_open = srm_env_proc_open, |
---|
| 124 | + .proc_read = seq_read, |
---|
| 125 | + .proc_lseek = seq_lseek, |
---|
| 126 | + .proc_release = single_release, |
---|
| 127 | + .proc_write = srm_env_proc_write, |
---|
145 | 128 | }; |
---|
146 | 129 | |
---|
147 | 130 | static int __init |
---|
.. | .. |
---|
198 | 181 | entry = srm_named_entries; |
---|
199 | 182 | while (entry->name && entry->id) { |
---|
200 | 183 | if (!proc_create_data(entry->name, 0644, named_dir, |
---|
201 | | - &srm_env_proc_fops, (void *)entry->id)) |
---|
| 184 | + &srm_env_proc_ops, (void *)entry->id)) |
---|
202 | 185 | goto cleanup; |
---|
203 | 186 | entry++; |
---|
204 | 187 | } |
---|
.. | .. |
---|
210 | 193 | char name[4]; |
---|
211 | 194 | sprintf(name, "%ld", var_num); |
---|
212 | 195 | if (!proc_create_data(name, 0644, numbered_dir, |
---|
213 | | - &srm_env_proc_fops, (void *)var_num)) |
---|
| 196 | + &srm_env_proc_ops, (void *)var_num)) |
---|
214 | 197 | goto cleanup; |
---|
215 | 198 | } |
---|
216 | 199 | |
---|