| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Sample kfifo byte stream 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> |
|---|
| .. | .. |
|---|
| 148 | 146 | return copied; |
|---|
| 149 | 147 | } |
|---|
| 150 | 148 | |
|---|
| 151 | | -static const struct file_operations fifo_fops = { |
|---|
| 152 | | - .owner = THIS_MODULE, |
|---|
| 153 | | - .read = fifo_read, |
|---|
| 154 | | - .write = fifo_write, |
|---|
| 155 | | - .llseek = noop_llseek, |
|---|
| 149 | +static const struct proc_ops fifo_proc_ops = { |
|---|
| 150 | + .proc_read = fifo_read, |
|---|
| 151 | + .proc_write = fifo_write, |
|---|
| 152 | + .proc_lseek = noop_llseek, |
|---|
| 156 | 153 | }; |
|---|
| 157 | 154 | |
|---|
| 158 | 155 | static int __init example_init(void) |
|---|
| .. | .. |
|---|
| 175 | 172 | return -EIO; |
|---|
| 176 | 173 | } |
|---|
| 177 | 174 | |
|---|
| 178 | | - if (proc_create(PROC_FIFO, 0, NULL, &fifo_fops) == NULL) { |
|---|
| 175 | + if (proc_create(PROC_FIFO, 0, NULL, &fifo_proc_ops) == NULL) { |
|---|
| 179 | 176 | #ifdef DYNAMIC |
|---|
| 180 | 177 | kfifo_free(&test); |
|---|
| 181 | 178 | #endif |
|---|