Commit 54279dd8 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] cleanup seqfile usage in resource.c

From: Jeff Muizelaar <muizelaar@rogers.com>

This patch against 2.5.70-bk2 removes the buffer allocation from resource.c
and lets seq_read do it instead.
parent d69e1f7a
...@@ -82,20 +82,7 @@ static int ioresources_show(struct seq_file *m, void *v) ...@@ -82,20 +82,7 @@ static int ioresources_show(struct seq_file *m, void *v)
static int ioresources_open(struct file *file, struct resource *root) static int ioresources_open(struct file *file, struct resource *root)
{ {
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL); return single_open(file, ioresources_show, root);
struct seq_file *m;
int res;
if (!buf)
return -ENOMEM;
res = single_open(file, ioresources_show, root);
if (!res) {
m = file->private_data;
m->buf = buf;
m->size = PAGE_SIZE;
} else
kfree(buf);
return res;
} }
static int ioports_open(struct inode *inode, struct file *file) static int ioports_open(struct inode *inode, struct file *file)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment