hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/samples/kfifo/inttype-example.c
....@@ -1,10 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Sample kfifo int type implementation
34 *
45 * Copyright (C) 2010 Stefani Seibold <stefani@seibold.net>
5
- *
6
- * Released under the GPL version 2 only.
7
- *
86 */
97
108 #include <linux/init.h>
....@@ -141,11 +139,10 @@
141139 return copied;
142140 }
143141
144
-static const struct file_operations fifo_fops = {
145
- .owner = THIS_MODULE,
146
- .read = fifo_read,
147
- .write = fifo_write,
148
- .llseek = noop_llseek,
142
+static const struct proc_ops fifo_proc_ops = {
143
+ .proc_read = fifo_read,
144
+ .proc_write = fifo_write,
145
+ .proc_lseek = noop_llseek,
149146 };
150147
151148 static int __init example_init(void)
....@@ -166,7 +163,7 @@
166163 return -EIO;
167164 }
168165
169
- if (proc_create(PROC_FIFO, 0, NULL, &fifo_fops) == NULL) {
166
+ if (proc_create(PROC_FIFO, 0, NULL, &fifo_proc_ops) == NULL) {
170167 #ifdef DYNAMIC
171168 kfifo_free(&test);
172169 #endif