mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
proc: convert everything to "struct proc_ops"
The most notable change is DEFINE_SHOW_ATTRIBUTE macro split in seq_file.h. Conversion rule is: llseek => proc_lseek unlocked_ioctl => proc_ioctl xxx => proc_xxx delete ".owner = THIS_MODULE" line [akpm@linux-foundation.org: fix drivers/isdn/capi/kcapi_proc.c] [sfr@canb.auug.org.au: fix kernel/sched/psi.c] Link: http://lkml.kernel.org/r/20200122180545.36222f50@canb.auug.org.au Link: http://lkml.kernel.org/r/20191225172546.GB13378@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
d56c0d45f0
commit
97a32539b9
@@ -142,11 +142,10 @@ static ssize_t fifo_read(struct file *file, char __user *buf,
|
||||
return ret ? ret : copied;
|
||||
}
|
||||
|
||||
static const struct file_operations fifo_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = fifo_read,
|
||||
.write = fifo_write,
|
||||
.llseek = noop_llseek,
|
||||
static const struct proc_ops fifo_proc_ops = {
|
||||
.proc_read = fifo_read,
|
||||
.proc_write = fifo_write,
|
||||
.proc_lseek = noop_llseek,
|
||||
};
|
||||
|
||||
static int __init example_init(void)
|
||||
@@ -169,7 +168,7 @@ static int __init example_init(void)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (proc_create(PROC_FIFO, 0, NULL, &fifo_fops) == NULL) {
|
||||
if (proc_create(PROC_FIFO, 0, NULL, &fifo_proc_ops) == NULL) {
|
||||
#ifdef DYNAMIC
|
||||
kfifo_free(&test);
|
||||
#endif
|
||||
|
@@ -135,11 +135,10 @@ static ssize_t fifo_read(struct file *file, char __user *buf,
|
||||
return ret ? ret : copied;
|
||||
}
|
||||
|
||||
static const struct file_operations fifo_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = fifo_read,
|
||||
.write = fifo_write,
|
||||
.llseek = noop_llseek,
|
||||
static const struct proc_ops fifo_proc_ops = {
|
||||
.proc_read = fifo_read,
|
||||
.proc_write = fifo_write,
|
||||
.proc_lseek = noop_llseek,
|
||||
};
|
||||
|
||||
static int __init example_init(void)
|
||||
@@ -160,7 +159,7 @@ static int __init example_init(void)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (proc_create(PROC_FIFO, 0, NULL, &fifo_fops) == NULL) {
|
||||
if (proc_create(PROC_FIFO, 0, NULL, &fifo_proc_ops) == NULL) {
|
||||
#ifdef DYNAMIC
|
||||
kfifo_free(&test);
|
||||
#endif
|
||||
|
@@ -149,11 +149,10 @@ static ssize_t fifo_read(struct file *file, char __user *buf,
|
||||
return ret ? ret : copied;
|
||||
}
|
||||
|
||||
static const struct file_operations fifo_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = fifo_read,
|
||||
.write = fifo_write,
|
||||
.llseek = noop_llseek,
|
||||
static const struct proc_ops fifo_proc_ops = {
|
||||
.proc_read = fifo_read,
|
||||
.proc_write = fifo_write,
|
||||
.proc_lseek = noop_llseek,
|
||||
};
|
||||
|
||||
static int __init example_init(void)
|
||||
@@ -176,7 +175,7 @@ static int __init example_init(void)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (proc_create(PROC_FIFO, 0, NULL, &fifo_fops) == NULL) {
|
||||
if (proc_create(PROC_FIFO, 0, NULL, &fifo_proc_ops) == NULL) {
|
||||
#ifdef DYNAMIC
|
||||
kfifo_free(&test);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user