hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/pnp/isapnp/proc.c
....@@ -1,20 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * ISA Plug & Play support
34 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
185 */
196
207 #include <linux/module.h>
....@@ -47,7 +34,7 @@
4734 nbytes = size - pos;
4835 cnt = nbytes;
4936
50
- if (!access_ok(VERIFY_WRITE, buf, cnt))
37
+ if (!access_ok(buf, cnt))
5138 return -EINVAL;
5239
5340 isapnp_cfg_begin(dev->card->number, dev->number);
....@@ -62,10 +49,9 @@
6249 return nbytes;
6350 }
6451
65
-static const struct file_operations isapnp_proc_bus_file_operations = {
66
- .owner = THIS_MODULE,
67
- .llseek = isapnp_proc_bus_lseek,
68
- .read = isapnp_proc_bus_read,
52
+static const struct proc_ops isapnp_proc_bus_proc_ops = {
53
+ .proc_lseek = isapnp_proc_bus_lseek,
54
+ .proc_read = isapnp_proc_bus_read,
6955 };
7056
7157 static int isapnp_proc_attach_device(struct pnp_dev *dev)
....@@ -82,7 +68,7 @@
8268 }
8369 sprintf(name, "%02x", dev->number);
8470 e = dev->procent = proc_create_data(name, S_IFREG | S_IRUGO, de,
85
- &isapnp_proc_bus_file_operations, dev);
71
+ &isapnp_proc_bus_proc_ops, dev);
8672 if (!e)
8773 return -ENOMEM;
8874 proc_set_size(e, 256);