Get the inode from the file instead of ->private, declare the show
function and let procfs open and free the seq_file.
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
drivers/nubus/proc.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/nubus/proc.c b/drivers/nubus/proc.c
index 3ea3d1738eae..cb21ad1d9964 100644
--- a/drivers/nubus/proc.c
+++ b/drivers/nubus/proc.c
@@ -107,7 +107,7 @@ nubus_proc_alloc_pde_data(unsigned char *ptr, unsigned int size)
static int nubus_proc_rsrc_show(struct seq_file *m, void *v)
{
- struct inode *inode = m->private;
+ struct inode *inode = file_inode(m->file);
struct nubus_proc_pde_data *pded;
pded = pde_data(inode);@@ -138,16 +138,8 @@ static int nubus_proc_rsrc_show(struct seq_file *m, void *v)
return 0;
}
-static int nubus_rsrc_proc_open(struct inode *inode, struct file *file)
-{
- return single_open(file, nubus_proc_rsrc_show, inode);
-}
-
static const struct proc_ops nubus_rsrc_proc_ops = {
- .proc_open = nubus_rsrc_proc_open,
- .proc_read = seq_read,
- .proc_lseek = seq_lseek,
- .proc_release = single_release,
+ .proc_show = nubus_proc_rsrc_show,
};
void nubus_proc_add_rsrc_mem(struct proc_dir_entry *procdir,
--
2.53.0