| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Sample kfifo int type implementation |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2010 Stefani Seibold <stefani@seibold.net> |
|---|
| 5 | | - * |
|---|
| 6 | | - * Released under the GPL version 2 only. |
|---|
| 7 | | - * |
|---|
| 8 | 6 | */ |
|---|
| 9 | 7 | |
|---|
| 10 | 8 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 141 | 139 | return copied; |
|---|
| 142 | 140 | } |
|---|
| 143 | 141 | |
|---|
| 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, |
|---|
| 149 | 146 | }; |
|---|
| 150 | 147 | |
|---|
| 151 | 148 | static int __init example_init(void) |
|---|
| .. | .. |
|---|
| 166 | 163 | return -EIO; |
|---|
| 167 | 164 | } |
|---|
| 168 | 165 | |
|---|
| 169 | | - if (proc_create(PROC_FIFO, 0, NULL, &fifo_fops) == NULL) { |
|---|
| 166 | + if (proc_create(PROC_FIFO, 0, NULL, &fifo_proc_ops) == NULL) { |
|---|
| 170 | 167 | #ifdef DYNAMIC |
|---|
| 171 | 168 | kfifo_free(&test); |
|---|
| 172 | 169 | #endif |
|---|